I have this code in a pages module page template:
{if segment_1 == 'admissions'}
{exp:channel:entries dynamic="no" channel="landing-page" entry_id="128" limit="1" cache="no"}
{if:elseif segment_1 == 'academics'}
{exp:channel:entries dynamic="no" channel="landing-page" entry_id="129" limit="1" cache="no"}
{if:elseif segment_1 == 'faculty'}
{exp:channel:entries dynamic="no" channel="landing-page" entry_id="130" limit="1" cache="no"}
{if:elseif segment_1 == 'lifeatacu'}
{exp:channel:entries dynamic="no" channel="landing-page" entry_id="133" limit="1" cache="no"}
{if:elseif segment_1 == 'about'}
{exp:channel:entries dynamic="no" channel="landing-page" entry_id="134" limit="1" cache="no"}
{if:elseif segment_1 == 'athletics'}
{exp:channel:entries dynamic="no" channel="landing-page" entry_id="142" limit="1" cache="no"}
{/if}But it always give the first entry. My first try was:
{exp:channel:entries dynamic="no" channel="landing-page"
{if segment_1 == 'admissions'}
entry_id="128"
{if:elseif segment_1 == 'academics'}
entry_id="129"
{if:elseif segment_1 == 'faculty'}
entry_id="130"
{if:elseif segment_1 == 'lifeatacu'}
entry_id="133"
{if:elseif segment_1 == 'about'}
entry_id="134"
{if:elseif segment_1 == 'athletics'}
entry_id="142"
{/if}
limit="1" cache="no"}And it always returns the last entry.
The other part of it is that I can run the latter If statement independent of the channel:entried before and after the code in question and the results are correct, just not where it counts.
Clearly I’m doing something wrong but I can’t figure out what.
For what it’s worth, here is the entire page (including extra if statements to test:
Begin IF
<!-- for test purposes -->
{if segment_1 == 'admissions'}
entry_id="128"
{if:elseif segment_1 == 'academics'}
entry_id="129"
{if:elseif segment_1 == 'faculty'}
entry_id="130"
{if:elseif segment_1 == 'lifeatacu'}
entry_id="133"
{if:elseif segment_1 == 'about'}
entry_id="134"
{if:elseif segment_1 == 'athletics'}
entry_id="142"
{/if}
End IF
{if segment_1 == 'admissions'}
{exp:channel:entries dynamic="no" channel="landing-page" entry_id="128" limit="1" cache="no"}
{if:elseif segment_1 == 'academics'}
{exp:channel:entries dynamic="no" channel="landing-page" entry_id="129" limit="1" cache="no"}
{if:elseif segment_1 == 'faculty'}
{exp:channel:entries dynamic="no" channel="landing-page" entry_id="130" limit="1" cache="no"}
{if:elseif segment_1 == 'lifeatacu'}
{exp:channel:entries dynamic="no" channel="landing-page" entry_id="133" limit="1" cache="no"}
{if:elseif segment_1 == 'about'}
{exp:channel:entries dynamic="no" channel="landing-page" entry_id="134" limit="1" cache="no"}
{if:elseif segment_1 == 'athletics'}
{exp:channel:entries dynamic="no" channel="landing-page" entry_id="142" limit="1" cache="no"}
{/if}
<nav class="grid_5">
<h2 class="subnav-header">{title}</h2>
<ul class="subnav">
{lp_subnavigation}<!-- this is a matrix loop -->
<a href="http://{link}class=subnav-button"><li>{title}</li></a>
{/lp_subnavigation}
</ul>
</nav>
<!-- for test purposes -->
channel = {channel}
segment_1 = {segment_1}
entry_id = {entry_id}
Begin IF
{if segment_1 == 'admissions'}
entry_id="128"
{if:elseif segment_1 == 'academics'}
entry_id="129"
{if:elseif segment_1 == 'faculty'}
entry_id="130"
{if:elseif segment_1 == 'lifeatacu'}
entry_id="133"
{if:elseif segment_1 == 'about'}
entry_id="134"
{if:elseif segment_1 == 'athletics'}
entry_id="142"
{/if}
End IF
{/exp:channel:entries}Bottom line what I need is there are pages, so example.com/faculty the code works great. But at example.com/faculty/nextlevel I’m trying to get the nav to act like if it was back one level.