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

Extending ImageGalleryPage


Go to End


3 Posts   1468 Views

Avatar
Mad_Clog

Community Member, 78 Posts

1 July 2009 at 8:47am

Hi,

I'm trying to extend ImageGalleryPage to make my own page type, basically just adding a couple of fields.
Nothing fancy so far, the problem however seems to arise when I try to create a template specific to the newly created page type.
For some reason it's not picking it up...

mysite/code/SplashPage.php

<?php
class SplashPage extends ImageGalleryPage {
}

class SplashPage_Controller extends ImageGalleryPage_Controller {
	
}
?>

mysite/templates/Layout/SplashPage.ss
<h1>blaat</h1>

Did a /dev/build/ after adding above files, created a page with the newly created SplashPage type.
However when i view the page it's using Page.ss for some reason...

I also tried above code but then with extending Page instead of ImageGalleryPage and that did work as intended.
So.... any thoughts?
Appreciate it!

- Geert

Avatar
UncleCheese

Forum Moderator, 4102 Posts

1 July 2009 at 9:04am

You need to create SplashPage_album.ss, too.

Avatar
Mad_Clog

Community Member, 78 Posts

1 July 2009 at 9:06am

If you were a girl I'd kiss you ;)
Cheers UC