3217 Posts in 853 Topics by 812 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 235 Views |
-
Use <% if %>

10 November 2012 at 4:00pm
I have a problem.Example:I have a image which show in both pages are contact page and gallery page
So,i writed in file .ss :
<% if ClassName=ContactPage %>
<img .... />
<% end_if %>But it's just work in ContactPage so i write again
<% if ClassName=ContactPage || ClassName=GalleryPage %>
<img .... />
<% end_if %>
And after ?flush=all,my browser show error:Parse error: syntax error, unexpected '}'...
I want to ask you,we can use "OR,AND" or " ||,&& " in <% if %> ??? -
Re: Use <% if %>

11 November 2012 at 4:23pm
Is this on 3.0 or 2.4? I tested 3.0 and <% if ClassName = HomePage || ClassName = GalleryPage %><p>hi</p><% end_if %> worked fine for me. In 2.4 you'll need to move the functions to the Page_Controller class.
// page.php
function ShowGallery() {
return ($this->ClassName == "ContactPage" || $this->ClassName == "GalleryPage");
}// template
<% if ShowGallery %>...
| 235 Views | ||
|
Page:
1
|
Go to Top |


