Conditionally show a page in the Navigation

Posted by Community Admin on 04-Aug-2018 14:13

Conditionally show a page in the Navigation

All Replies

Posted by Community Admin on 27-Jun-2012 00:00

Hi there.
I was wondering if there is a way to add a property to pages that I could read while going through the site map pages and decide based on some other criteria if I should show the page or not.
Is there a way to add such a property to a page?  If yes, am I limited to only one property, or can I have more? 
Thanks for your help!

Posted by Community Admin on 27-Jun-2012 00:00

Other than the Show in Navigation property already there?

Posted by Community Admin on 27-Jun-2012 00:00

Hi Brett.
Yes, we need to conditionally show a page based on the user state/province selection.
We unfortunately can't use the "Show in Navigation" flag for the page as you can see.
Would you know of a way to achieve this at the page level?  I don't feel like maintaining a DB table with this information - this is bound for trouble in the long run :s

thanks!

Posted by Community Admin on 27-Jun-2012 00:00

Are you creating a control that hides/shows these pages in a navigation?  It is kind hard to give suggestions without knowing the final result.

Is the state/province somehow stored in the URL of the site?   If it is, you could create a control or a handler that could do what you are trying to achieve.  Using your example, I also have an instance where a different CSS file needed to be loaded depending on what state the user is in.  Fortunately, my URL has the state in it so my control that determines the CSS classes can pull the information based on the state.  If this is the case, I should be able to help you further.

If you are wanting to setup these new properties on the create/edit page, it currenlty isn't possible.  There are various posts on how to attempt to do this but they result in the new properties do not persist.  I recently had a support question asking for this very thing and I received the following response:

Thank you for using our service!

There is no sample of doing this. We have a feature request logged. You can track it at the public URL bellow and vote for its popularity:
http://www.telerik.com/support/pits.aspx#/details/Issue=6839

We are aware of the increased demand for this functionality, and are discussing its scheduling for the upcoming releases, so your feedback is indeed very much appreciated.

Posted by Community Admin on 27-Jun-2012 00:00

Thanks for the answer.
Unfortunately, the parameter (the province) won't be on the querystring/url.
It will however be part of a Session variable.  However, in my custom navigation, I need to identify pages that need to be shown in certain situations - this is the hardest part.
I guess I will rely on backend DB table which I will be able to query and decide based on certain fields if the page is to be included in the navigation menus or not.

Thanks again for your help - this is surely something I will vote for in an upcoming release!

This thread is closed