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.

Template Questions /

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

Access CustomSiteConfig DataObjects


Go to End


2 Posts   1609 Views

Avatar
VRoxane

Community Member, 42 Posts

6 July 2014 at 10:25pm

Hi ! I'm using SStripe 3.1.4 on my project.

I created DataObject "Picto" that are related to CustomSiteConfig via a has_many relationship.

It works perfectly in the backend and I can add my Pictos but I can't loop and show them in the templates.

I tried several things like :

<% loop CustomSiteConfig %>
	<% loop Pictos %>
		<a href="$Lien" class="picto">$Titre $Image - Picto -</a>
	<% end_loop %>
	<% end_loop %>

but I couldn't list my pictos :(

Any idea ?

Avatar
thomas.paulson

Community Member, 107 Posts

9 July 2014 at 2:11pm

replace CustomSiteConfig with Siteconfig

<% loop SiteConfig %>
<% loop Pictos %>
<a href="$Lien" class="picto">$Titre $Image - Picto -</a>
<% end_loop %>
<% end_loop %>