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.


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

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

Getting data from another page

Go to End

9 Posts   2997 Views


16 January 2008 at 4:19am Community Member, 19 Posts

I think this should be a real simple one but for some reason I can't seam to manage it.
I have a slogan that runs through all my site.
Currently I have a custom "Slogan" field in the CMS for every page type. And I retype the slogan into there for every page.
What I want to do is to get the "Slogan" field from the top most parent HomePage page type.
I might have two HomePage page types fathering different children with different slogans and so I would like the page that is asking for the slogan to pick it up from it's first parent HomePage page type.

Is there any way this could be done?


16 January 2008 at 4:40am Community Member, 501 Posts

yes, of course:

In your template:


Or, when you're not in a child:

<% control Page(home) %>$Slogan<% end_control %>


16 January 2008 at 4:51am Community Member, 19 Posts

I knew there was an almost blindingly simple way to do this.

But say I want the template to grab the "Slogan" from it's topmost parent.
Just using $Parent.Slogan will only go one level up.
How would I get to the root HomePage dynamically without giving it a hardcoded name using the:

<% control Page(home) %>$Slogan<% end_control %>

Cheers for the quick reply.


16 January 2008 at 4:56am Community Member, 501 Posts

You can't change the name of the homepage anyway, so you'll always have to call it 'home'.

But I figure something like $Parent.Parent.Slogan could work, but I'm not sure, havent tried it.

(do not forget to flush everytime you change yr template... otherwise you might not see the changes)


16 January 2008 at 4:59am Community Member, 19 Posts

Thanks m8.

Wasn't aware you could chain variables like that.


16 January 2008 at 5:00am Community Member, 501 Posts

It's just a guess... I haven't tried it so it might fail :)


17 January 2008 at 9:25pm Community Member, 19 Posts


I just wanted to let you know that I figured out a way to get to the root and suck out my slogan.
All I have to use is:

<% control Level(1) %>
<% end_control %>

It was that simple.
Thanks for all your post comments you helped me a lot.


17 January 2008 at 9:30pm Community Member, 501 Posts


you might be interested in this page:

If you haven't already found it by now :)

Go to Top