Incremental Publishing + Navigation

Hi everyone,

Hoping someone can provide some pointers, or best practices on how to handle this. We are looking at implementing incremental publishing on our site, but find that our publishing isn’t catching changes to our section navigation.

For a little background, we’re using managed navigation to handle the landing pages for each folder, but also using an autolist to display all the links available in each section. Originally, the autoslots were registered in the templates, which meant that incremental was publishing out most of the site every time. Once I unregistered the slots, the publishing list went down to what I’d expect, BUT now it’s not updating the section nav on other pages if there’s a change.

Are there any recommended ways around this? Some way to establish a parent-child relationship between items in a folder and their landing page for instance? Does the managed navigation figure at all in incremental publishes?

Thanks,
Brian

You need to have a full non-binary to handle any navigational changes. Incremental doesn’t take into account template or nav changes every-time.

There has been some recent work in Engineering related to Managed Navigation for incremental editions to improve on this, but the updates haven’t made it into a release or patch yet. Currently the related elements in the Nav Tree aren’t touched, so the incremental doesn’t pick them up.

Best practice wise for many of the larger sites that we’ve been implementing, where a full edition just isn’t possible, is to use an SSI type of tactic for this. In this approach, You essentially create a series of snippet templates that generate a server side include file for bread crumbs and and for navigational sections. Using this strategy you can create non incremental content lists that will always include the various nav elements. Adding these to an Incremental or full edition will cause Only the Navigational snippets to be published in full, as opposed to publishing the entire site.

Here is an example of a snippet template for a breadcrumbs SSI include. The template is configured to generate .shtml (Apache style SSI), but the approach can be applied to any target web server that supports includes.

yourSnippetNavBreadcrumbs


#set($a = $sys.assemblyItem.getCloneParentItem().getId() )
#if ("$!a" == "" || $tools.list.get($sys.params.get('sys_context'), 0) =="0" )
		#macro(breadcrumb)
            #set($ancestors = $user.psoNavTools.getAncestors($nav.self) )##
            #foreach($node in $ancestors)##
				#if($velocityCount > 1)
                #set($title = $node.getProperty("rx:displaytitle").String)##
                #if($velocityCount > 2) >  #end##
                #if($velocityCount == $ancestors.size() )##
        			$title##
                #else
        			#set($landing_page = $node.getProperty("nav:url").String)##
        			<a href="$landing_page">$title</a>##
                #end##
				#end
            #end##
        #end##
        <div id="breadcrumbs">##
			#breadcrumb()##
        </div>
#else
#generateInclude($nav.self)
#end

Where the generateInclude macro looks like this:


## Used to build the SSI for Navons
#macro(generateInclude $node $maxLevel)##
#set($ancestors=$user.psoNavTools.getAncestors($node))##
#if($ancestors.size()<=$maxLevel)
	#set($maxLevel=$tools.math.sub($ancestors.size(),1)))##
#end##
#set($node=$ancestors.get( $maxLevel ))##
#set($cloneditem = $sys.assemblyItem.clone())##
$cloneditem.setNode($node)##
#set($parameters = $cloneditem.getParameters().remove("sys_folderid"))##
##$cloneditem.setFolderId(-1)##
#set($location= $rx.location.generate($cloneditem,$cloneditem.Template))##
#set($dq = '"')## "
#set($lb = '#')## #
#set($includeBeginning = "<!--${lb}include virtual=${dq}")##
#set($includeEnding = "${dq} -->")##
#set($include = "${includeBeginning}${location}${includeEnding}")##
$include##
#end

You would then create a non-incremental content list that is configured specifically for NavOns and the templates.:

JCR:

select rx:sys_contentid, rx:sys_folderid from rx:rffNavon where jcr:path = '//Sites/YourSite/%' 

Template Expander:

sys_ListTemplateExpander

Template Param:

yourSnippetNavBreadcrumbs, yourSnippetBottomNav, your other nav templates, etc

A similar content list would be created for your landing pages.

Obviously this is an example, and every implementation is slightly different, but SSI can be a great way to work around the current Full Publish requirement for Managed Navigation changes, giving you a finer grained control over what gets published when.

Hope this helps.

-nate