Jump to:

7939 Posts in 1472 Topics by 944 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » Getting Description On Album Page

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Page: 1
Go to End
Author Topic: 1236 Views
  • Liam
    Avatar
    Community Member
    470 Posts

    Getting Description On Album Page Link to this post

    Quick question, I want just the current album's description listed on the specific album page. I can only loop through all of the descriptions, not get just one. I see there is an $AlbumTitle var, so wondering if there is something like $AlbumDescription or similar?

  • UncleCheese
    Avatar
    4085 Posts

    Re: Getting Description On Album Page Link to this post

    Oooh.. good idea. I've checked that into SVN for you.

  • Liam
    Avatar
    Community Member
    470 Posts

    Re: Getting Description On Album Page Link to this post

    Excellent, cheers.

    I'm out of the office and will get working on this later. Mind telling me which file the change applies to? I have a decently modified version and I used SVN to download the copy onto my computer, and then upload it to the server. I no longer have the original version. (don't ask) haha.

    While I'm here, any chance of having pagination for the album list? I have one image gallery page, and a lot of albums within it. I'd like to show the last X per page. Like how it works for amount of photos per page for the actual album.

  • UncleCheese
    Avatar
    4085 Posts

    Re: Getting Description On Album Page Link to this post

    I believe ImageGalleryPage.php has the change. Just FYI, in recent revisions, ImageGallery has become a lot more extendible through subclassing. You can now use custom Album, Image, and Page classes for ImageGallery which is designed to keep you out of the core code so you have the liberty to customize, but still get updates without any snags.

    I don't have a timeframe for the album pagination. If you want to write the code in your modified version, send it along, and I'll ratify and check it in.

  • Liam
    Avatar
    Community Member
    470 Posts

    Re: Getting Description On Album Page Link to this post

    Okay great. Thanks good to hear about the new subclassing. I can't remember which version I'm currently running, but this will come in handy. I always dreaded upgrading and hoped to never have to (generally speaking of course), but I guess I'll take the time to do things proper to avoid this in the future.

    One last note, not sure if you're aware but album titles can't have apostrophes in them or things bork. At least in my version.

  • pinkp
    Avatar
    Community Member
    168 Posts

    Re: Getting Description On Album Page Link to this post

    Hi did this feature get added? I have the latest SVN of ImageGalleryPage.php, how can include the Album Description of each page please?

    I tried:
    <% control Albums %>
       <p>$Description</p>
       <% end_control %>

    &

    <% control Albums %>
       <p>$AlbumDescription</p>
       <% end_control %>

    But produces all or nothing. Thanks!

  • UncleCheese
    Avatar
    4085 Posts

    Re: Getting Description On Album Page Link to this post

    What do you mean "all or nothing?" Do you just want to show the description of the current album? You should be able to use <% control CurrentAlbum %>.. I would think.

  • pinkp
    Avatar
    Community Member
    168 Posts

    Re: Getting Description On Album Page Link to this post

    Yeah sorry all or nothing was a bit cryptic! I meant all descriptions or none.
    But anyway you solved it thanks!! CurrentAlbum not Albums! makes sense!

    1236 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.