7921 Posts in 1359 Topics by 933 members
DataObjectManager Module
SilverStripe Forums » DataObjectManager Module » Resource Holder?
Discuss the DataObjectManager module, and the related ImageGallery module.
Moderators: martimiz, UncleCheese, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 547 Views |
-
Resource Holder?

8 July 2010 at 2:32am Last edited: 8 July 2010 2:37am
I have a portfolio section on my website. At the moment it is very simple: the 'resource' consist of a title, description, an image, and a URL, and they are all shown on the same page.
How would I go about creating a 'holder' page which displays only the titles and an image of all resources, but then when clicked on, goes to another page with just the details of that dataobject?
EDIT: found something in the tutorials which will hopefully help http://doc.silverstripe.org/tutorial:2-extending-a-basic-site
-
Re: Resource Holder?

8 July 2010 at 3:52am
I'm not really getting it, I still think I need some help!
Firstly, can make a 'holder' page in the CMS which will hold all the dataobjects?
Secondly, how do I then make a separate page to display one selected dataobject when the link is clicked.
Thanks again.
-
Re: Resource Holder?

8 July 2010 at 4:43am
Have you checked out the "code examples" sticky in this forum?
-
Re: Resource Holder?

9 July 2010 at 2:37am Last edited: 9 July 2010 2:48am
EDIT: Realised I was looking at the wrong example, nothing to see here!
-
Re: Resource Holder?

9 July 2010 at 3:23am
Sorry, I'm still stuck. I've removed all the parts relating to groups in the Resources example you've made with ResourcesOverview, but how do I get the ResourcesOverview page to display? I can only select 'Resource Page' in the CMS and this shows every Resource.
I removed all this code, should I have kept some in?
public function Resources()
{
$all_resources = new DataObjectSet();
if($user = Member::currentUser()) {
if($groups = Member::currentUser()->Groups()) {
foreach($groups as $group) {
if($r = $group->Resources("ResourcePageID = $this->ID AND Global = 0"))
$all_resources->merge($r);
}
}
}
$global_resources = DataObject::get("Resource","ResourcePageID = $this->ID AND Global = 1");
if($global_resources)
$all_resources->merge($global_resources);
$all_resources->removeDuplicates();
return $all_resources;
}
Thank you for your patience. -
Re: Resource Holder?

9 July 2010 at 4:20am
I think I'm going to instead use a Jquery plugin to load everything on one page and then hide and unhide elements, seems much simpler!
| 547 Views | ||
|
Page:
1
|
Go to Top |

