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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Customising the CMS /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

how to access current page properties from page controller


Go to End


2 Posts   2770 Views

Avatar
billa

Community Member, 2 Posts

13 March 2009 at 6:16am

Edited: 13/03/2009 6:19am

Hi, I'm trying to build a link feed of local site pages whose meta tags match the current page. I'm having some difficulty accessing the current pages' meta tags. I know that so far, I want to return something like this:

$MetaTags = MetaKeywords of the current page, how do I get this?

return DataObject::get("SiteTree", "MetaKeywords LIKE '%$MetaTags%'");

Can anyone point me in the right direction?

Thanks!

Avatar
billa

Community Member, 2 Posts

14 March 2009 at 3:44am

I found the keywords in $this->MetaKeywords