Now I am assuming I am being thick here. I have tried a few things, and can't get this to work for me.
Basically I have document types that I don't want shown on the menu.
My current very simple solution is a True/False tick box with an Alias of "umbracoNaviHide", whcih works fine so long as you tick it.
Obviously for items that I never want to show in the menu it would make sence to me to have a fixed value that I can add, instead of having to tick something. In other words have something with an alias of "umbracoNavHide" permanently set to true (or I think 1 would be the same thing).
I have played with an "Noedit" data type, but I really just don't get how this one actually works. I have read quite a bit about it, but it's not doing what I need, or possibly more realistically I am not doing it properly.
Perhaps there is a much simple way of doing this and I am just not seeing it. Any help much appreciated.
Thanks for the comments, That does kinda make sence, but one immediate thought, umbracoNaviHide is an actual Umbraco supported property, is "showInMainNavigation", as a quick websearch didn't reveal anything. umbracoNaviHide is detailed in the Best Practice part of the website (http://our.umbraco.org/wiki/reference/umbraco-best-practices/umbraconavihide).
Either way I am thinking of my less web savy customer who find doing anything with a website really stressful, and when things don't appear or appear when they should not getting even more stressed.
So my question still stands if I want something to never or always be shown is there a way to add a fixed value to a document type? Even a way to set the default value of a tick box to ticked?
You're right, umbracoNaviHide is a convention, it's a convention for hiding something, going back it used to part of an install, it no longer is, the reason it gets used is some of the sample scripts use it.
Could you please explain "counter intuative" (not the meaning of the words, but how what I want to do is counter intuative). I am not being defensive, if I am not using best practice, or there is a better way then, that's what I want to do. I just want it to be as simple for my customers as possible to use the interface. It seems right to me if something should always be displayed then why have it go to tick it to be displayed, or if it should not be displayed, why should I have to tick it not to be displayed? What am I missing here?
If you don't want a DocType to ever display on the menu then just ensure they don't in your XSLT / Razor script, you don't have to set a checkbox to true on every node of that DocType.
Doesn't that mean that I have to check every DocType, which on bigger sites could be up to 10 or more different types (which is a lot to check), hence a single value for show or not show makes sence to me. Am I being thick here? I don't mind if the answer is yes, I just seem to be missing the point?
Lets assume that my site will have:
To be displayed:
Standard page
Contact page
Enquiry form
Twio column page
Not to be displayed (on menu)
News article
Case study
Staff member
So there are a number of different DocTypes the either need to eb displayed or not. So to check for number of DocTypes seems messy to me.
There are many different ways to do this, it's personal preference.
You don't have to check 10 DocTypes, your script can just exclude the DocTypes you don't want on the menu. It's all done via cached XML so performance won't be any issue.
Fixed value for Document Types
Hi All,
Now I am assuming I am being thick here. I have tried a few things, and can't get this to work for me.
Basically I have document types that I don't want shown on the menu.
My current very simple solution is a True/False tick box with an Alias of "umbracoNaviHide", whcih works fine so long as you tick it.
Obviously for items that I never want to show in the menu it would make sence to me to have a fixed value that I can add, instead of having to tick something. In other words have something with an alias of "umbracoNavHide" permanently set to true (or I think 1 would be the same thing).
I have played with an "Noedit" data type, but I really just don't get how this one actually works. I have read quite a bit about it, but it's not doing what I need, or possibly more realistically I am not doing it properly.
Perhaps there is a much simple way of doing this and I am just not seeing it. Any help much appreciated.
Thanks
Stephen
Hey Stephen,
We actually do it the other way around, we add a 'showInMainNavigation' True/False property and only items which have this set to true get shown.
Rich
(@Rich yeah, makes much more sense when true means something is enabled - or do something)
Hi Guys,
Thanks for the comments, That does kinda make sence, but one immediate thought, umbracoNaviHide is an actual Umbraco supported property, is "showInMainNavigation", as a quick websearch didn't reveal anything. umbracoNaviHide is detailed in the Best Practice part of the website (http://our.umbraco.org/wiki/reference/umbraco-best-practices/umbraconavihide).
Either way I am thinking of my less web savy customer who find doing anything with a website really stressful, and when things don't appear or appear when they should not getting even more stressed.
So my question still stands if I want something to never or always be shown is there a way to add a fixed value to a document type? Even a way to set the default value of a tick box to ticked?
Thanks
Stephen
Hey Stephen,
You're right, umbracoNaviHide is a convention, it's a convention for hiding something, going back it used to part of an install, it no longer is, the reason it gets used is some of the sample scripts use it.
What you're trying to do is counter intuative, but try the Standard Values Package http://our.umbraco.org/projects/developer-tools/standard-values-in-umbraco
Rich
Hi Rich,
Thanks for your reply.
Could you please explain "counter intuative" (not the meaning of the words, but how what I want to do is counter intuative). I am not being defensive, if I am not using best practice, or there is a better way then, that's what I want to do. I just want it to be as simple for my customers as possible to use the interface. It seems right to me if something should always be displayed then why have it go to tick it to be displayed, or if it should not be displayed, why should I have to tick it not to be displayed? What am I missing here?
I am off to look at standard-values-in-umbraco.
Thanks
Stephen
Maybe counter intuative is the wrong expression.
If you don't want a DocType to ever display on the menu then just ensure they don't in your XSLT / Razor script, you don't have to set a checkbox to true on every node of that DocType.
Rich
Hi Rich,
Doesn't that mean that I have to check every DocType, which on bigger sites could be up to 10 or more different types (which is a lot to check), hence a single value for show or not show makes sence to me. Am I being thick here? I don't mind if the answer is yes, I just seem to be missing the point?
Lets assume that my site will have:
To be displayed:
Standard page
Contact page
Enquiry form
Twio column page
Not to be displayed (on menu)
News article
Case study
Staff member
So there are a number of different DocTypes the either need to eb displayed or not. So to check for number of DocTypes seems messy to me.
Thanks
Stephen
Hey Stephen,
There are many different ways to do this, it's personal preference.
You don't have to check 10 DocTypes, your script can just exclude the DocTypes you don't want on the menu. It's all done via cached XML so performance won't be any issue.
Rich
Hi Rich,
Thanks for all your comments.
I like the idea of using XML to exclude.
Obviously I have no idea how to do this, do you know of any example for razor?
I did check before I asked, I have done a number of searches, I am just not 100% sure what to search for.
Thanks
Stephen
Hey Stephen,
Can you post the Razor you are using?
Rich
Hi Rich,
Sure this is what I am currently using.
The second version of the sub is just me being lazy, add different classes and ID to the ULs.
This code just renders a 3 level menu, where the umbracoNaviHide is set to false.
Thanks
Stephen
Hi Rich,
I guess this is the type of thing you are talking about, I modified ulMenu to include this:
After reading a number of other posts etc, I found most of this info covered in The Razor Feature Walkthrough.
If you had something else in mind, would be good if you could share.
But this essentially fixes my problem two fold.
I can still opt to hide items from the menu.
Only certain types of DocType will be displayed in the menu (those listed with their name in full in the "Dictionary".
Anyway hope this helps someone else too.
Thanks
Stephen
Hey Stephen,
Sorry I didn't get the time to come back with a code sample, seems like you solved it anyways :)
Looks like an more elegent solution than your original one, nice work
Rich
Thanks.
All that reading helps me to learn and improve anyway. So all good.
Thanks for all your help, I would not have got to where I am without it.
Stephen
is working on a reply...