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

Returning $this->customise with an #anchor


Go to End


405 Views

Avatar
Alpha41

Community Member, 3 Posts

12 September 2017 at 5:59am

OK so I've been racking my brains to figure out the best way of achieving this and wonder if anyone has any experience of ideas?!?

We've heavily extended a version of MemberProfiles for a MemberDirectory based website and are providing a number of DataObjects within a front-end tab structure for editing. Part of this is an event calendar. Naturally, users what to be able to search for event within specific data criteria. Functionality wise, we've got it all working, but ONLY if we return $this->customise. This wouldn't normally be an issue, however using the Zurb Foundation 6 framework to display the data within a tab structure, we need to direct the users back to the URL with an #anchor appended to ensure the correct tab re-opens on page launch.

We can achieve the #anchor and correct page launch using a GET method, but the results won't populate (we assume because MemberProfilePage.php already uses the index() function? Then the $this->customise will produce the results, but not reload the page on the correct tab (always default).

So.... is there a way of adding an #anchor to the customise() or renderWith() based on this existing return code?
return $this->customise(array('eventResults' => $eventResults))->renderWith(array('MemberProfilePage_profile', 'MemberProfilePage'));

Any help would be massively appreciated as we're cutting it fine for beta testing and have 2 other little quirks that need addressing :(

Thanks guys
Antony