Skip to content

Instantly share code, notes, and snippets.

@stevewithington
Last active April 27, 2018 19:10
Show Gist options
  • Save stevewithington/4beaa20759602cb6b85a8cb43ef8f3e0 to your computer and use it in GitHub Desktop.
Save stevewithington/4beaa20759602cb6b85a8cb43ef8f3e0 to your computer and use it in GitHub Desktop.
Mura CMS: Custom primary navigation with primary associated images as links.
<!--- Mura 6.2 Syntax (will work in 7.0 as well) --->
<cfset it = $.getBean('feed').addParam(relationship='AND', field='parentid', condition='EQ', criteria='00000000000000000000000000000000001').getIterator() />
<!--- Mura 7.0 Syntax --->
<!--- <cfset it = $.getBean('feed').where().prop('parentid').isEQ('00000000000000000000000000000000001').getIterator() /> --->
<cfif it.hasNext()>
<ul>
<cfloop condition="it.hasNext()">
<cfset item = it.next() />
<li>
<a href="#item.getURL()#">
<cfif item.hasImage()>
<img src="#item.getImageURL('small')#" alt="#esapiEncode('html_attr', item.get('menutitle'))#" />
<cfelse>
#esapiEncode('html', item.get('menutitle'))# <!--- This item does not have a primary image --->
</cfif>
</a>
</li>
</cfloop>
</ul>
</cfif>
@LeandrordnaeL
Copy link

It's not showing me my "Home" Icon on the nav.. it skips home page link and starts to render the 1st page under Home.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment