20 September 2010 at 10:40am
(Last edited: 20 September 2010 10:50am),
Presumably, you are returning a DataObject through that page.
add the following to your DataObject class
Because you are accessing the controller directly, there is no Page object associated with the request and therefore no existing Meta Tags to use. The above code will allow you to return the Meta Tag values you have assigned to your DataObject through your view function.
20 September 2010 at 7:23pm
I am showing a DataObject on that page by urlParams['ID']. I tried SiteTree::MetaTags() as a return value but it didn´t work. MetaTags in not a static function.
Thanks for Your hint anyways. I implemented a function MetaTags() in the SomePage_Controller and now it works. This isn´t a clean solution i suppose.