How did you manage to get ImageGallery to generate pages from the DataObjectSet and it's own Urls's for the albums. I can see the line where the links are being created with
public function Link()
The thing I don't understand is how silverstripe recognizes this information and knows where to go.
I want to do a similar thing to what you are doing. Have a data page with lots of entries and then click on an object to take it to a pregenerated page showing the information for that object only. So when you are in the cms you only have one page in the left navigation and adding extra data is just done from the tabs. Then on the front end I can list the onjects in a page and link through to them for more info.
Dynamic Pages are fairly simple. See the link to the page
return $this->ImageGalleryPage()->Link('album/'.$this->Folder()->Name); outputs a link like site.com/gallery/album/my-photos
URLs in SS can be read like /Controller/Action/ID so that above URL translates to calling the album() method on the Controller for the page with the URLSegment 'gallery' which in this case is the 'GalleryPage_Controller'.
So if you look at GalleryPage.php at the GalleryPage_Controller you will see a function album() which outputs the page content for the 'my-photos' album. You can see more detail my looking at that method. You can also define a separate template for the album page. Normally you would have a GalleryPage.ss template but with the 'album' action you can make a GalleryPage_album.ss template to style it differently
Thanks for the quick reply. I read around some topics as well on the url method. I got it working as you said with /Controller/Action/ID and I can see the objects in my data set. How about if I want to do /Controller/Action/ID/$otherId? I tried that and the page would load up I could extract $ID still but I couldn't get read $otheID. Any idea why that would be? I have looked all over and haven't seen any examples of second level URL inputs. Thanks again for the quick reply.
Yeah, you can create arbitrary URL actions/parameters. They are called rewrite rules (not to be confused with mod_rewrite rules) and can be placed in your mysite/_config.php file. Look here for details:
The one that is used by default for controllers is this one: