3217 Posts in 853 Topics by 812 members
| Go to End | ||
| Author | Topic: | 2641 Views |
-
Re: Custom vars in both PHP and SS templates

25 June 2010 at 7:27pm
AmpedUp - Thanks for the suggestions, I think your last one would probably have worked fine.
[For the record - I found an entirely different way of factoring the behaviour I needed so this became a bit irrelevent in the end, but it's good to know there was a solution if I had needed one]
jf/
-
Re: Custom vars in both PHP and SS templates

26 March 2011 at 1:05am
An old post, but if anyone is still interested:
I found allthough something like <% if Top.SomeSetting = SomeValue %> will generate a parsing error, simple checking on true or false <% if Top.SomeSetting %> seems to work allright, meaning you could check on some Top setting from within a control structure and retrieve a sub property (in 2.4.5):
// in the Page_Controler
function isTheRightPage() {
return ($this->Title == 'SomeTitle')? true: false;
}<% control MyObjects %>
<% if Top.isTheRightPage %>
<!-- do something with the object based on the page title %>
<% end_if %>
<% end_control %>
| 2641 Views | ||
| Go to Top |

