Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Philip Hayton 98 posts 435 karma points
    Jun 24, 2019 @ 12:00
    Philip Hayton
    0

    Folder in Content Tree

    Hi guys,

    I'm not even sure if this is possible, but I've got a lot of nodes at the root of the site and I'd like to group them into folders, like you can in the media section.

    I don't want the folder to affect the URL of it's descendants though. In effect, it's a kind of 'virtual node', whose only purpose is to make the editor experience a little neater.

    For example:

    -- Home

    ---Folder

    ----Page

    The URL for page would still be /page/

    Is this possible at all?

    I've tried creating a custom UrlSegmentProvider, returning string.Empty, but unfortunately descendant nodes are showing as published but not in the content cache.

    As always, thanks in advance for any assistance!

    Kind regards

    Phil

  • Marc Goodson 2155 posts 14408 karma points MVP 9x c-trib
    Jun 24, 2019 @ 13:23
    Marc Goodson
    100

    Hi Philip

    There is a V7 package that does this:

    https://our.umbraco.com/packages/website-utilities/virtualnodes/

    The code won't work with V8, but the theory is the same: (eg names of methods, and variables have changed between v7 and v8)

    The code is here https://github.com/sotirisf/Umbraco-VirtualNodes

    but essentially I think you'll need a register custom IContentFinder to 'find' the content at the url with the 'folder' missing. I think the message you see in the backoffice - is Umbraco trying to confirm it can find the content at the generated url, which is why you see the message.

    Docs have been updated for V8 here: https://our.umbraco.com/Documentation/Reference/Routing/Request-Pipeline/outbound-pipeline

    Often it can be easier to create a UrlProvider that inherits DefaultUrlProvider, and remove the folder from there.. but sounds like you have the segment bit working ok!

    regards

    Marc

  • Philip Hayton 98 posts 435 karma points
    Jun 24, 2019 @ 13:26
    Philip Hayton
    0

    Brill, thanks for the quick response Marc. :)

Please Sign in or register to post replies

Write your reply to:

Draft