0

I have a static page that I don't have a specific channel for. Its just a contact form, and I don't see any reason to have it be a channel entry because there's not really content there to change or update. However, I have breadcrumbs and I use the code below to tell the breadcrumbs what to display, and given that there is no channel entry for my contact form, the breadcrumb shows up as blank. Is there a way to just assign a fake channel name to the contact page so that this code will work, or do I have to make a channel for it? or is there some other work around?

{if segment_2 != ""}
     <li class="breadcrumb"><p><a href="{path={segment_1}}">{channel}</a></p></li>
     <li class="breadcrumb"><p>{title}</p></li>
{if:elseif segment_2 == ""}
     <li class="breadcrumb"><p>{channel}</p></li>
{/if}
2

Typically when I want to only show certain snippets of code when I know the URL is fixed, I hard code the segment value in. So in your case I would just change your advanced conditional to:

{if segment_2 != ""}
 <li class="breadcrumb"><p><a href="{path={segment_1}}">{channel}</a></p></li>
 <li class="breadcrumb"><p>{title}</p></li>
{if:elseif segment_1 == "contact-us"}
 <li class="breadcrumb"><p>Contact</p></li>
{if:else}
 <li class="breadcrumb"><p>{channel}</p></li>
{/if}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.