5099 Posts in 1519 Topics by 1116 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1525 Views |
-
Controlling Page_results.ss

4 April 2009 at 7:40am
When I do
<% if ClassName = HomePage %> it returns ture on my search results! There are some bits that I don't wish to show on the results page that are on the Home page (for example I have a flash carousel that is controlled with a checkbox 'has_carousel').I tried something like this:
<% if hasFlashCarousel %>
<% if ClassName = Page_results %>
... do nothing
<% else %>
include carousel...
<% end_if %>
<% end_if %>but <% if ClassName = Page_results %> is not working... any ideas how i control this?
-
Re: Controlling Page_results.ss

4 April 2009 at 6:25pm
In your function results() in mysite/code/Page.php add another entry to your return array(... ) bit
'ClassName' = 'Page_results'
as you call the results method on the current page you are viewing it inherits all the information from this page. So if you search from the homepage it does http://silverstripe.org/home/SearchForm.. which loads the results but ontop of the home page. Passing the returned array another option should fix it
-
Re: Controlling Page_results.ss

16 April 2009 at 12:21am Last edited: 16 April 2009 12:48am
Ah awesome thanks!
PS
'ClassName' => 'Page_results'
| 1525 Views | ||
|
Page:
1
|
Go to Top |


