17488 Posts in 4473 Topics by 1978 members
| Go to End | ||
| Author | Topic: | 6341 Views |
-
Re: Control scope

13 September 2008 at 11:29pm
Hi, we have version 2.2.2 and $Top does not seem to do anything. Can you confirm it still works?
We're trying to build a pretty in depth site (http://fiction.previews.umguk.vvhp.net/staging/) but without $Top working we're a little stuck.
This is an example that does not work:
$Title
<% control Menu(1) %>
<% control children %>
$Top.Title
<% end_control %>
<% end_control %>The $Top.Title displays nothing.
Hope you can help.
-
Re: Control scope

13 September 2008 at 11:46pm
Maybe $top is in trunk or removed.. you can do <% control Level(1) %>$Title<% end_control %. to get the topmost then
-
Re: Control scope

15 September 2008 at 8:15pm
Thanks for such a speedy reply, that does indeed allow me to reference built in values.
I was hoping it would give me the context of the ContentController, so I can call functions.
I'm trying to call functions as I would normally do before entering into the scope of a 'control', but it seems this is only possible before you use a 'control' block.
Is there another way I can reference functions of the ContentController once we're inside a 'control'? This is really important to the sites we build and severely limiting if this is not possible.
Matt
-
Re: Control scope

15 September 2008 at 9:47pm
try placing your functions in the Page class instead of the controller class.
That often makes the methods reachable ...
-
Re: Control scope

15 September 2008 at 11:35pm
Aha, have got the $Top working! I just downloaded the latest nightly build and it works as I'd hoped, hoorah!
I was relying on the latest stable build 2.2.2 which it seems has lost that feature.
Thanks
Matt
| 6341 Views | ||
| Go to Top |



