Opening in a Nav Landing Page Link in a new window

In the past I have added a field like new_window in on the rffNavon and rffNavTree content types.
Then if I field new_window is set to Y, the managed navigation code would open the landing page link in a new window.

Another way to do it is to use the type of link template in the Managed Navigation Slot rffNavLandingPage.
So usually you might want a file content type to open in a new window.

Using the FFWD content type rffFile it would use a snippet template called rffSnTitleLinkNewWin.

rffSnTitleLinkNewWin source

<body style=“background-image:none; background-color:#ffffff;”>
<span class=“lead_snippet”>
<a href="$pagelink" class=“titlelink” target=_blank>
#fieldLink(“displaytitle” $pagelink)
</a>
</span>
</body>

This macro landingPage_Target will inspect the template you use in the rffNavLandingPage Slot to see if it opens a link in a new window, by seeing if it contains target=_blank.

Put this macro in user User Velocity Macros

#macro(landingPage_Target $node)
##Code to figure out if the Landing Page opens in a new window
#set ($slotContent="#node_slot($node ‘rffNavLandingPage’ ‘’ ‘’ ‘’ ‘’ ‘’)")
#if($slotContent.indexOf(“target=_blank”) >0)
#set($target=“target=_blank”)
#else
#set($target="")
#end
$target
#end

Using this macro from common Managed Navigation Code

#set($landing_page = $node.getProperty(“nav:url”).String)##
<a href="$landing_page" #landingPage_Target($node)>$title</a>