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.

DataObjectManager Module /

Discuss the DataObjectManager module, and the related ImageGallery module.

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

imagegallery module different template another section of site


Go to End


6 Posts   1248 Views

Avatar
zim

Community Member, 135 Posts

26 March 2010 at 9:06am

I have implemented imagegallery module (IGM) on two different sections of my site (photos, products).

I want the album display for my products to be slightly differnt to my photos but i can not seem to change the display of 'ImageGalleryPage_album.ss'.

I have tried putting if statement in as follows but does not work.

<% if Page(productAlbum) %>...

Can anyone help?

Avatar
UncleCheese

Forum Moderator, 4102 Posts

26 March 2010 at 9:36am

I usually tag my body with id="$URLSegment" and class="$ClassName".. that way you can make subtle changes in your CSS on a page-by-page basis without having to create new templates.

Avatar
zim

Community Member, 135 Posts

26 March 2010 at 9:53am

Cool.

I now get

<body id="what-we-sell-2" class="ImageGalleryPage">

obviously the class="ImageGalleryPage" will be the same on all imagegallery pages so

I try

<% if $URLSegment == what-we-sell-2 %>

but does not work. can I use this approach?

Avatar
UncleCheese

Forum Moderator, 4102 Posts

26 March 2010 at 10:04am

Edited: 26/03/2010 10:04am

No, no... CSS is your friend!

body#your_id #gallery_layout { some rule }

Avatar
zim

Community Member, 135 Posts

26 March 2010 at 10:11am

perfect!

...can't believe I did not see that!

have been struggling with that for a few days..

Thanks!!

Avatar
Juanitou

Community Member, 323 Posts

26 March 2010 at 10:33pm

And don’t forget that you cannot use $ inside controls, that should work (note the single = operator):

<% if URLSegment = what-we-sell-2 %>

Hope it helps… later.