All my recent projects has implemented umbracoNaviHide inside a True/False property, and they all work just fine. In my 7.6.9 upgraded project, I simply cannot get a True/False value to work.
On my Master composition, I have a "Navigation" tab together with a True/False property. All my pages inherit through that composition.
When I do something like:
var menuItems = CurrentPage.Site().Children;
@foreach(var item in menuItems) {
if(item.IsVisible()) {
<!--show element-->
}
}
It doesn't work. It should work, as it has in all my lastest projects. Here's what I've tried:
var menuItems = CurrentPage.Site().Children.Where("Visible");
var menuItems = CurrentPage.Site().Children.Where("umbracoNaviHide == false"); //setting this to true gives me no results
var menuItems = CurrentPage.Site().Children.Where(x => x.IsVisible());
var menuItems = CurrentPage.Site().Children.Where("randomProperty == false"); //or true
foreach(var item in menuItems) {
if(!item.HasValue("umbracoNaviHide)) { <!-- show item --> }
if(item.GetPropertyValue("umbracoNaviHide")) == "false") { <!-- show item --> }
}
I think that's all. I did update my ModelsBuilder. I did restart the project. I did remove the property and readd it. I basically tried everything, but it just won't work.
It doesn't work. I've completely removed the tab, saved, created a new property and renamed it into "somethingRandom". Then tried with GetPropertyValue("somethingRandom") == "false" and Where("somethingRandom" == "false").
One more thing that you can try out, remove the property from the composition Master document type and add it to the document type which is used for creating the content node.
So that only THAT one content node has it? All my content nodes inherit from a homepage content node, but not as the document type, because I don't want them to inherit using nested inheritage.
So you want me to add the umbracoNaviHide property to a single node, such as the homepage I have?
Okay our.Umbraco.org is acting up right now. Most of my replies aren't appearing on the page. Keep the replies as single replies, not as nested replies.
I removed the file, republished the site, and compared the two files. They're identical. Completely identical.
umbracoNaviHide doesn't work
All my recent projects has implemented umbracoNaviHide inside a True/False property, and they all work just fine. In my 7.6.9 upgraded project, I simply cannot get a True/False value to work.
On my Master composition, I have a "Navigation" tab together with a True/False property. All my pages inherit through that composition.
When I do something like:
It doesn't work. It should work, as it has in all my lastest projects. Here's what I've tried:
I think that's all. I did update my ModelsBuilder. I did restart the project. I did remove the property and readd it. I basically tried everything, but it just won't work.
What on earth?
Hi Morten,
can you just add a screenshot of your property on your composition document type?
/Michaël
Hi Michael
Here it is: https://i.imgur.com/j2ciMsv.png
Here is a composition inherited document type: https://i.imgur.com/CcqeVPb.png
"Gem fra menuen" means "Hide from the menu".
Morten,
can you try to rename the alias of the property to something else and test this to see if the property then work in your razorcode?
/Michaël
It doesn't work. I've completely removed the tab, saved, created a new property and renamed it into "somethingRandom". Then tried with
GetPropertyValue("somethingRandom") == "false"
andWhere("somethingRandom" == "false")
.This is so weird.
Morten,
can you add a screenshot of the content node where you use this property?
Also how is the modelsbuilder set? Can you add a screenshot of this ( located in the developer section ).
/Michaël
I sent you a content node screenshot that shows it has the property on it: https://i.imgur.com/CcqeVPb.png
The ModelsBuilder is set to Dll. Here's a screenshot: https://i.imgur.com/9iruy0d.png
Hmmm thats very weird...
Maybe its a caching issue, can you republish your entire site and see if that helps?
/Michaël
Did multiple times and it didn't work.
One more thing that you can try out, remove the property from the composition Master document type and add it to the document type which is used for creating the content node.
/Michaël
So that only THAT one content node has it? All my content nodes inherit from a homepage content node, but not as the document type, because I don't want them to inherit using nested inheritage.
So you want me to add the umbracoNaviHide property to a single node, such as the homepage I have?
Correct, to test that the issue is not related to the composition inheritance.
/Michaël
I cannot get that to work either.
Weird, I don't think my reply went through.
Nope, I cannot get that to work either.
Okay this is soooooooooooooooooooooooooooooooooooo weird. Take a look at this:
This gives me the following:
However, this is how the
umbracoNaviHide
is setup in the backoffice:How the flying hell is this possible?
Can you remove the xml file from the app_data folder which contains all the data of your content and republish your site?
/Michaël
App_Data or its child folders does not contain any XML files (except an empty one inside \TEMP\ClientDependency).
Also, if I change
Our offers
's property to not ticked, it still remains as FALSE. If I do the same forTechnology
it changes between FALSE and TRUE.I'm 100% sure at this point, that I'm encountering a bug.
Sry I mean the
App_Data/umbraco.config
file, thats the file which contains all content details./Michaël
Ah yeah, I did that now and it didn't change anything, unfortunately. The newly generated file is the exact same as the old.
Okay our.Umbraco.org is acting up right now. Most of my replies aren't appearing on the page. Keep the replies as single replies, not as nested replies.
I removed the file, republished the site, and compared the two files. They're identical. Completely identical.
Hi Morten,
Can you try this?
After that a foreach as usual...
Not with currentPage but with Model. Just giving it a shot, it's a strange problem but you never know...
Kind regards,
Benoit
It sounds like a caching issue and indexes not being rebuilt. Remove
App_Data/umbraco.config
and/or try rebuilding from the backoffice.is working on a reply...