Hello All,
I’ve read the EE docs, searched the forums and tried numerous variations, but the only way I can get my conditional statements to work is with the code below. I expect that there is a cleaner, lighter way to do this, and wonder if anyone would be so kind to show me. 😊
<div id="printdet_table"> <!-- Print Details table div. Contents controlled via misc. content weblog. -->
{if custom_field_two == "1" AND custom_field_three == "A"}
{exp:weblog:entries weblog="misc_content" disable="categories|pagination|trackbacks|member_data" dynamic="off" url_title="tier_1_price_table_a"}
{page_body}
{/exp:weblog:entries}
{if:elseif custom_field_two == "1" AND custom_field_three == "B"}
{exp:weblog:entries weblog="misc_content" disable="categories|pagination|trackbacks|member_data" dynamic="off" url_title="tier_1_price_table_b"}
{page_body}
{/exp:weblog:entries}
{if:elseif custom_field_two == "2" AND custom_field_three == "A"}
{exp:weblog:entries weblog="misc_content" disable="categories|pagination|trackbacks|member_data" dynamic="off" url_title="tier_2_price_table_a"}
{page_body}
{/exp:weblog:entries}
{if:elseif custom_field_two == "2" AND custom_field_three == "B"}
{exp:weblog:entries weblog="misc_content" disable="categories|pagination|trackbacks|member_data" dynamic="off" url_title="tier_2_price_table_b"}
{page_body}
{/exp:weblog:entries}
{if:else}
Please enquire for size and price details regarding this image.
{/if}
</div> <!-- closes Print Details table (printdet_table) div -->In dBase III-type syntax and I suppose PHP, one would likely use “case” (with “switch” if php) for a list of conditionals that is more than three options or so long. What is best here? I can see this set growing by two more options, possibly more. I tried one option using “url_title=”{embed:tier_1_price_table_a}” which I found here in the forum, but I couldn’t get the syntax to fly. It seemed like it might be a little lighter.
(The current url_titles are long for my sanity while chipping at this.)
Thank you for any help.