Issue #4431 duplicate

Internal link without

Anonymous created an issue

Internal links that do not have an existing page currently produce 404s when followed. Perhaps they could link to a new action / view that produces a "This page does not currently exist" method with a "Would you like to create this page" option for editors (a la http://en.wikipedia.org/wiki/Wikipedia:Red_link).

On our local copy I've done a simple workaround in the LinkParsed method in Roadkill.Core.Converters MarkupConverter to redirect them straight to a new page (by also adding an optional title parameter to the New method on the Pages control). Code as follows but assumes all users have editor rights:

{{{

!c

                // Parse internal links
                PageManager manager = new PageManager();
                PageSummary summary = manager.FindByTitle(href);
                if (summary != null)
                {
                    href = helper.Action("Index", "Wiki", new { id = summary.Id, title = summary.Title.EncodeTitle() });
                }
                else
                {
                    href = helper.Action("New", "Pages", new {title = e.Text, newPage = "true" });
                    href = href.Replace(e.Text.ToLower(), e.Text);
                }

}}}

Comments (3)

  1. Log in to comment