Hi, Ataul -
One thing I’d warn you about is that with advanced conditionals everything inside is parsed first so you still have the overhead. If you use simple conditionals, then those things do NOT get parsed and your site is far better optimized.
Example of simple conditional:
{if channel_short_name == "news"}
your stuff
{/if}
Example of advanced conditional - pretty much anything that uses if:else, or if:elseif, such as in your code.
Also, you’re using:
The last segment won’t even exist if it’s blank. Try this in a template to see what I mean:
last segment: {last_segment}
{if last_segment == ''} - last segment is blank {/if}
{if last_segment == 'hi'} - last segment is hi{/if}
Then try visiting:
http://example.com/site/template/ <- last segment would in theory be segment 3 here, but it doesn’t exist to test.
http://example.com/site/template/hi - third segment is hi and you’ll get ‘last segment is hi’ when you view your template.
You’ll never get ‘last segment is blank’
So, I’d recommend testing against a segment you know should be there - either 2 or 3, most likely.
Make sense?