Last active
August 29, 2015 14:09
-
-
Save bryanburgers/212ac7b65bffd2fa3f16 to your computer and use it in GitHub Desktop.
I wish I had more control over Structure output
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Basic output --> | |
<ul> | |
{exp:structure_output:nav depth="2"} | |
<li class="{if struct:first}first{/if} {if struct:last}last{/if} {if struct:here}here{/if} {if struct:parent_here}parent-here{/if}"> | |
<a href="{struct:url}">{struct:title}</a> | |
{if struct:children:count} | |
<ul> | |
{struct:children} | |
</ul> | |
{/if} | |
</li> | |
{/exp:structure_output:nav} | |
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Classes got verbose. Simplify them? --> | |
<ul> | |
{exp:structure_output:nav depth="2"} | |
<li class="{struct:classes}"> | |
<a href="{struct:url}">{struct:title}</a> | |
{if struct:children:count} | |
<ul> | |
{struct:children} | |
</ul> | |
{/if} | |
</li> | |
{/exp:structure_output:nav} | |
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Custom fields --> | |
<ul> | |
{exp:structure_output:nav depth="2"} | |
<li class="{struct:classes}"> | |
{if struct:channel == 'external'} | |
<!-- Use a custom field --> | |
<a href="{struct:external_url}" rel="external">{struct:title}</a> | |
{if:elseif struct:channel == 'something'} | |
<!-- Use a custom field --> | |
<a href="{struct:url}"><img src="{struct:something_img}"></a> | |
{if:else} | |
<a href="{struct:url}">{struct:title}</a> | |
{/if} | |
{if struct:children:count} | |
<ul> | |
{struct:children} | |
</ul> | |
{/if} | |
</li> | |
{/exp:structure_output:nav} | |
</ul> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment