Change value of umbracoNaviHide depending on document type
I have an faqPage and on the page are faqItems. Document types defined as follows
master homePage faqPage
faqItem textPage
umbracoNaviHide property added in master and inherited. In most cases umbracoNaviHide needs to be set to false but for faqItems (which are only rendered on the faqPage and do not appear as pages in their own right) I want to default it to true (do not want to have to explain this to users).
That's exactly how I did it in the end - works like a treat.
Thanks
Jules
public class onNewDocSetUmbracoNaviHide : ApplicationBase { public onNewDocSetUmbracoNaviHide() { Document.New += new Document.NewEventHandler(Document_New); }
Great that you got your problem solved, but with that solution the users still has the option to set the umbracoNaviHide to false and then make it vissible in the menu, right? Don't know if this is a problem for you, but instead you could just remove the faqItem nodes from your navigation by exclude the document type.
Well, if your current solution is just fine for now, thee's of course no need to change that. Just wanted to mention it :)
You mean exclude it in the xslt? Yes that was always a possibility - at the time however I was just poking around in the api and wanted to do that way,
Addtionally I put the umbracoNaviHide property on its own tab called Menu and hid the tab using AttackMonkeys eminently useful TabHider.
Change value of umbracoNaviHide depending on document type
I have an faqPage and on the page are faqItems. Document types defined as follows
master
homePage
faqPage
faqItem
textPage
umbracoNaviHide property added in master and inherited. In most cases umbracoNaviHide needs to be set to false but for faqItems (which are only rendered on the faqPage and do not appear as pages in their own right) I want to default it to true (do not want to have to explain this to users).
Is there a common way to achieve this?
Cheers
Jules
Hi Jules,
I think most people do it by using the API - see the wiki documentation at http://our.umbraco.org/wiki/reference/api-cheatsheet/using-applicationbase-to-register-events. ; If you're struggling, I can give you some sample code which I use to default values when I'm back in the office at work.
James.
Hi James
That's exactly how I did it in the end - works like a treat.
Thanks
Jules
Jules, fantastic, glad you got it sorted. James.
Hi Julian
Great that you got your problem solved, but with that solution the users still has the option to set the umbracoNaviHide to false and then make it vissible in the menu, right? Don't know if this is a problem for you, but instead you could just remove the faqItem nodes from your navigation by exclude the document type.
Well, if your current solution is just fine for now, thee's of course no need to change that. Just wanted to mention it :)
/Kim A
You mean exclude it in the xslt? Yes that was always a possibility - at the time however I was just poking around in the api and wanted to do that way,
Addtionally I put the umbracoNaviHide property on its own tab called Menu and hid the tab using AttackMonkeys eminently useful TabHider.
Thanks for the comment :-)
Cheers
Jules
Cool Julian. That's totally fine. Just wanted to come up with a quick note if you hadn't thought about it already :)
/Kim A
is working on a reply...