7939 Posts in 1472 Topics by 944 members
|Go to End|
12 November 2009 at 5:38am
I have installed DataObjectManager and am storing Image, title, URL and Category. this resource is available on every page, so amended page.php with necesary code to create BannerResource Tab in CMS.
I am doing this for banners so I am setting the categories to Home, News, CaseStudies.
I would like that when I go to a case studies page in CMS and then click on BannerResources TAB then only the images which have been marked as CaseStudies for category will show up. I can do this once I have entered page as I have a drop down on the resources page created with
'Category', // The field we're filtering
'Filter by Category', // The label for the filter field
'Home' => 'Home',
'CaseStudies' => 'CaseStudies',
'News' => 'News',
'Portfolio' => 'Portfolio'
) // The dropdown map of values => display text. The values will be matched against the Author field.
But I want it to filter on load of page in CMS automatically. Does this make sense?
Can it be doen?
15 November 2009 at 9:16pm
I don't quite follow you sorry. Mainly because I don't understand your model for this.
Is Banner a DataObject? If so, can you post the code for this and the getCMSFields code for your Page.php?
16 November 2009 at 5:31am
If you're going to force the filter, why use a dropdown filter? Why not just use the filter clause in the DOM constructor?
16 November 2009 at 9:42am Last edited: 16 November 2009 9:53am
What UC means is there is a filter clause when you create the DOM in your getCMSFields method.
// Setup the Options table Dataobject manager
$options = new DataObjectManager(
array('Name' => 'Banner Name'),
"Category = '$this->Category'", // Here is the filter - Get a category from the page, and filter Banners by that Category only
Or something along those lines. (Sorry for lake of indentation - for the life of me I can't get indents to preseve when I submit posts)
23 November 2009 at 12:29pm
Thanks for advice.. I had to change my model in the end and do things differently. BUt thanks
|Go to Top|