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

Template rendering in Registry module.


Go to End


3 Posts   1082 Views

Avatar
dave.m

Community Member, 19 Posts

25 March 2015 at 7:01pm

Anyone using the Registry module and have it rendering a custom template?
I'm following along with the example in the doco which says the following:
"As a further layer of customisation, you can create templates that will be only used when viewing specific registries. So if you wanted to create a template that would only be used to view the StaffMember registry, you would create RegistryPage_StaffMember.ss and RegistryPage_StaffMember_show.ss"

My class is called StaffMember, I have the template in Layouts, it always falls back to Page.ss - however the "RegistryPage_StaffMember_show.ss" template does render for a specific item when clicking through.
Registry Doco

Thx
Dave

Avatar
Pyromanik

Community Member, 419 Posts

26 March 2015 at 12:39am

I'd log a github issue as the template finder function (https://github.com/silverstripe-labs/silverstripe-registry/blob/master/code/RegistryPage.php#L424) only occurs in the file twice; the declaration and the show method.

I'm not familiar with the module, nor have I scrutinised the code that well, but it seems to me that there should at least be another reference (probably in an index() function or the like), as to my knowledge this function is also not overriding a declaration further up the heirarchy chain that is used by ViewableData.

So seems like a bug by omission.

Avatar
dave.m

Community Member, 19 Posts

26 March 2015 at 1:35am