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.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Hyperlinking to DataObjects on a Display Page


Go to End


2 Posts   1070 Views

Avatar
b00mtastik

Community Member, 18 Posts

19 September 2013 at 10:30am

Hey SS'ers,

My current dilemma seems to be something I don't exactly even know how to search for it much less know if its even been done before. I know there could be other ways to display what I'm trying to display, but that doesn't satisfy the curiosity of how to do it if I ever needed it, which I do.

For example I have a profile page that displays all member data in a sort of a directory for an intranet. Some data has been omitted because its not allowed to be seen by all staff. Okay. These members are of course dataobjects sitting in the database.

Now there are certain departments where those certain staff members are working in, and I would put there name down as part of that department.

Now, I WANT to be able to hyperlink said name to a matching member dataobject so that when clicked on it brings up the profile page or the directory display page to display all the data of that one member.

Does anyone know how to go about this?

The only alternative I know of is to loop the member objects details and display them on each department page with their image and have no linking, and leave the searching of the directory as a separate thing altogether.

Thanks in advanced.

-b00mer

Avatar
Bambii7

Community Member, 254 Posts

19 September 2013 at 12:53pm

Checkout custom Controllers. You'll be able to customise a url to point to a specific function like renderMember() with something like mysite.com/member/$ID

inside renderMember if you use $this->renderWith( ) you'll be able to control the display

checkout similar http://stackoverflow.com/questions/13375517/how-silverstripe-custom-controller-and-view-template-works