Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Is template parsing linear?

Quote Reply
Is template parsing linear?
I have this problem with this code:

Code:
<%generate_paths%>
<%if Image_1_width > Image_1_height%>
<%set orientation = "landscape"%>
<%elseif Image_1_width < Image_1_height%>
<%set orientation = "portrait"%>
<%else%>
<%set orientation = "portrait"%>
<%endif%>


I have verified that the image dimensions are correct.

The problem is with the prev_url tag. If you click on previous or next, ALL of the links with the template in which the above code is found are set to 'landscape' even if they are portrait.

I am puzzled by this behaviour and wonder if code in templates is executed linearly or if perhaps next_url & prev_url bypass this code when clicked...
Quote Reply
Re: [scorpioncapital] Is template parsing linear? In reply to
Try this:
Code:
...
<%if Image_1_width > $Image_1_height%>
<%set orientation = "landscape"%>
<%elseif Image_1_width < $Image_1_height%>
<%set orientation = "portrait"%>
...
The general rule is to use the dollar sign for all variables that appear to the right hand side of an equation/comparison.

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Post deleted by scorpioncapital In reply to
Quote Reply
Re: [yogi] Is template parsing linear? In reply to
Thanks, your advice worked!