17488 Posts in 4473 Topics by 1978 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 2571 Views |
-
Insection(page-url) control block

20 June 2007 at 3:57pm
Hey guys, I want to be able to limit a form to a specific page, without having to create a seperate page type I assume the best way is to use a control block that shows the form depending on what page the user is on.
I tried
<% if InSection("formpage") %>
$someForm
<% end_if %>but I get a parse error complaining about a missing } in the tmp file.
Its not the code in the controller that the parse error is complaining about I have checked that.
-
Re: Insection(page-url) control block

21 June 2007 at 2:45am
You can do an if statement based on the "Page Name" field like this:
<% if Title = Home %>
WELCOME HOME!
<% end_if %>That syntax is explained here under "If blocks": http://doc.silverstripe.com/doku.php?id=templates#template_syntax
Hope this helps,
Elijah
-
Re: Insection(page-url) control block

21 June 2007 at 10:31pm
You shouldn't have quotes around formpage in the insection bit
<% if InSection(formpage) %>
| 2571 Views | ||
|
Page:
1
|
Go to Top |



