Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Archive

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Accessing variables within a <control>


Reply

7 Posts   2370 Views

Avatar
Fuzz10

21 September 2007 at 8:35pm Community Member, 787 Posts

Hi !

I'm currently working on a dual-language website. I tied the word-list to the homepage so the user can maintain this list themselves. Accessing theses variables in the template works like a charm, except when I'm in a control block.

Here's an example (I'm in the homepage template):

<% control LatestNews %>
   <div class="case_news">
    <h2>$MetaTitle</h2>
    $MetaDescription
    $Read_more
   </div>
<% end_control %>

SS cannot access the $Read_more variable now (since it's linked to the Homepage).

If I place $Read_more _outside_ of the control block , it will work.

Anyone knows how i can access the variable from within the control ?

Thanks !

Avatar
Andy

24 September 2007 at 9:59am 230 Posts

$Link will do what you want, you don't need to create $Read_more.

Avatar
Fuzz10

24 September 2007 at 8:53pm Community Member, 787 Posts

Thanks for your reply.

$Link produces a correct hyperlink to the item, but that is not my problem. I can't seem to figure out how to switch languages. "Read more" should read "lees meer" in Dutch (so the $Read_more string only contains text , no URL or anything.

Avatar
Andy

25 September 2007 at 10:01am 230 Posts

Oh, I get ya, sorry! Try $Parent.Read_more

Avatar
Fuzz10

25 September 2007 at 6:59pm Community Member, 787 Posts

Thanks, but nope. Can't seem to get to that variable (or to a function defined in the homepage-controller).

Avatar
Alex S

9 September 2008 at 3:59am Community Member, 30 Posts

Having the same issue, no joy so far...

Avatar
Fuzz10

9 September 2008 at 7:22pm Community Member, 787 Posts

Alex :

try :
$Top.variable