Uploaded image for project: 'Bitbucket Cloud'
  1. Bitbucket Cloud
  2. BCLOUD-4431

Internal link without

    XMLWordPrintable

Details

    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

    Description

      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);
      				}
      

      }}}

      Attachments

        Activity

          People

            Unassigned Unassigned
            Anonymous Anonymous
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: