Having a small issue with some conditionals on a weblog entry.
Essentially I have a series of entries in a weblog and the client has asked that certain ones appear on certain pages. I have therefore created the following:
{if segment_1 == ""}
{assign_variable:entryid="53"}
{if:elseif segment_1 == "about"}
{assign_variable:entryid="99"}
{if:elseif segment_1 == "whatwedo"}
{assign_variable:entryid="71"}
{if:elseif segment_1 == "venues"}
{assign_variable:entryid="103"}
{if:elseif segment_1 == "wowfactors"}
{assign_variable:entryid="98"}
{if:elseif segment_1 == "news"}
{assign_variable:entryid="107"}
{if:elseif segment_1 == "contact"}
{assign_variable:entryid="53"}
{/if}
{exp:weblog:entries weblog="whatwedo" entry_id="{entryid}" disable="member_data|pagination|trackbacks|categories|category_fields" limit="1"}
......
{/exp:weblog:entries}However, whatever page I’m on - the value of entryid always seems to be 53.
Alternatively, I’ve tried unsucessfully to try it as follows :
{exp:weblog:entries
weblog="whatwedo"
limit="1"
dynamic="off"
disable="member_data|pagination|trackbacks|categories|category_fields"
{if segment_1 == ""}
entry_id="53"
{if:elseif segment_1 == "about"}
entry_id="99"
{if:elseif segment_1 == "whatwedo"}
entry_id="71"
{if:elseif segment_1 == "venues"}
entry_id="103"
{if:elseif segment_1 == "wowfactors"}
entry_id="98"
{if:elseif segment_1 == "news"}
entry_id="107"
{if:elseif segment_1 == "contact"}
entry_id="53"
{/if}
}
...
{/exp:weblog:entries}I don’t really want to have to repeat my {exp:weblog:entries} and HTML for *every* if statement - I’m sure I’ve done it like this similar in the past, but can’t for the life of me remember….
Cheers!
C.