Copied to clipboard

Flag this post as spam?

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


  • Owain Williams 481 posts 1413 karma points MVP 7x c-trib
    Jul 17, 2015 @ 11:20
    Owain Williams
    0

    Hiding folders if date has passed?

    Is there a way to hide folders from displaying on the front end if the date has passed?

    i.e. enter image description here

    Ideally I would like to hide July 06 because that date has passed,

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Jul 17, 2015 @ 11:55
    Dennis Aaen
    0

    Hi Owain,

    You can do it on a low key solution by adding the true / false data type to the document type and give it as of umbracoNaviHide.

    If you tick it then the folder will hide from the frontend.

    Hope this could be a solution.

    /Dennis

  • Owain Williams 481 posts 1413 karma points MVP 7x c-trib
    Jul 17, 2015 @ 12:39
    Owain Williams
    0

    Thanks Dennis, but the problem I have with that is I still want to show the full list of races on other pages.

    It has given me an idea though, I could put a check box on it race, folder, and then do a check to see if that box has a value. If it does, then hide it.

    Would that work?

  • Mark Bowser 273 posts 860 karma points c-trib
    Jul 17, 2015 @ 16:37
    Mark Bowser
    0

    So if you have a scenario like

    Upcoming Races
    2015
        July
            06
                Race 1
            07
                Race 2
                Race 3
        August
            15
                Race 4
            17
                Race 5
    

    and the current date is August 16th, you would want to render this?

    Upcoming Races
    2015
        August
            17
                Race 5
    

    If you don't want the content editor to need to do any work, you could check all of the child nodes of each Year, Month, and Day to see if they have any children that aren't old and expired yet. If they have some, render them. If they don't, filter them out.

    Do your races have the date of the race picked on them?

  • Owain Williams 481 posts 1413 karma points MVP 7x c-trib
    Jul 17, 2015 @ 17:55
    Owain Williams
    0

    Thanks for your reply Mark, Yes. you are correct with your scenario and each race does have a datatype "uBlogsyPostDate".

    So if CurrentDate is greater than "uBlogsyPostDate" then the race should drop off that list.

    Ideally I would like the site to do this itself so that the content editor just adds a race and can then forget about it.

Please Sign in or register to post replies

Write your reply to:

Draft