Adding UmbracoNaviHide to Baseline project. How to...
# help-with-umbraco
c
Hey all, We have an Umbraco Cloud baseline project which is a parent to roughly 25 other projects. This morning i've added the umbracoNaviHide property to all of the pages and have updated the various listings to use the Visible() method for displaying. Ive also updated our examine based listings to include:
Copy code
csharp
 query.And().Field("umbracoNaviHide", 0.ToString());
to filter the various examine based lists we have before returning the results to the view. Ofcourse this means the examine index (In this case the external one) needs rebuilding with this new property everywhere. Is there anyway to force all child projects of a baseline to perform a republish/rebuild of that index on push?
l
Not sure if this will work, but at the top level node, on the save and publish button there is a down arrow, click that and publish with children (or something like that, will double check when I’m at my computer shortly), you’ll then be asked if you wish to income all descendent. That should go through and republish every page
c
Hey Lewis, Indeed, aware of that, just wondering if its possible to do that automatically as when I roll the update out to the 25 child projects, it'll be a bit of a laborious task to republish on each site 😅
l
Ah got you, in that case I’m not certain 😬
s
That would be a very heavy operation and AFAIK is not supported. The way to deal with it usually is by testing
if(umbracoNaviHide) != false
so that you only check if it is true, if it's not available it will be
false
and if it is set to
false
it will be false. Not ideal, but it will wokr.
c
Hey Sebastiaan, So would that be testing for it "after" the examine query in this instance? ie: Perform Examine query with normal parameters. Loop over the results collection with something like a Where clause on Umbraco Navi Hide Return new collection of results
s
Ah I didn't twig on Examine. I don't know what happens in examine really when a field is missing - you should try that out. The field will not be there until you save a value to it. So
query.Not().Field("umbracoNaviHide", 1.ToString());
might work?
c
Ah i getcha, reverse the logic so that the forced republish / rebuild isnt needed. Shall give it a crack!
Yep all working, thank you sir!
s
Yay!
20 Views