Image Name Length, Subalbum name lenght

Not sure if this is already a feature however I would like an option to limit the sub album name length and even the image name length in the gallery views so that a consistent number of thumbnails is shown on each page and each thumbnail is the same size.

Comments

  • fretzl Administrator, Developer
    What theme are you using ?
  • I am using the Effervescence+ theme. I am more than open to other themes suggestions. This one just looked simple but had some nice features.

    TIA
  • Basically, under Themes, make a copy of the theme and modify various pages. Use function shortenContent to do what you want:
    http://www.zenphoto.org/documentation/core/_functions.php.html#functionshortenContent
  • fretzl Administrator, Developer
    Please also read the theming tutorial.
    http://www.zenphoto.org/news/theming-tutorial
  • fretzl Administrator, Developer
    To help you on your way a bit...

    In your theme folder (themes > effervescence_plus) locate the album.php file.

    Change line 118 from
    `<?php printAlbumTitle(); ?>`
    to
    `<?php echo shortenContent(getAlbumTitle(), 20, '...'); ?>`

    Where "20" is the length of the title and "..." is de shorten indicator.
  • Thanks for this this sounds just what I am after. I am able to find and edit the code but exactly what to I am unsure of. The '...' what is this do I put exactly as you say or experiment with it to get what I am after. I will start giving it a go but any further help for a non coder would be appreciated.
  • fretzl Administrator, Developer
    The '...' what is this do I put exactly as you say or experiment with it to get what I am after.

    That is simply an indicator that the text is shortened.

    For example
    Lorem ipsum dolor sit amet consectetur adipiscing elit
    becomes
    Lorem ipsum dolor si...
    (20 characters + ...)

    You can change the "..." to anything you like or leave it out completely.
    The code would then look like this:
    `<?php echo shortenContent(getAlbumTitle(), 20); ?>`

    So yes, experiment with it ;-)
  • Thanks for your help. However it must be the wrong place to achieve what I am after as I can not get a result.

    What I am after is to just shorten 1st layer sub album title when displayed in the gallery under the thumbnail so that all the thumbnails display on the page neatly. If it is possible to display the full title in the breadcrumbs at the top once selected that would be a bonus.

    My only other alternative is to shorten the folder names.

    Sorry but I just dont know the make up of the program enough and firebug is not helping me identify the area to change like you suggested which I am sure is the correct way to do it.
  • fretzl Administrator, Developer
  • fretzl Administrator, Developer
    Try the same change in gallery.php line 75

    I think you are not using the correct naming convention.
    http://www.zenphoto.org/news/zenphoto-glossary
  • I think you are right I just haven't got the full knowledge on this. I can follow the instruction with no problems and even extend them a certain bit to possibly fix it to make it work but when I get nothing or an error I'm probably stuffed.

    I am now getting this error
    Warning: Missing argument 3 for shortenContent(), called in /home10/sungazer/public_html/sungazer.info/themes/Davids_Effer/gallery.php on line 75 and defined in /home10/sungazer/public_html/sungazer.info/zp-core/functions.php on line 169
  • fretzl Administrator, Developer
    Sorry, my mistake. The code should be:
    `<?php echo shortenContent(getAlbumTitle(), 20, '...'); ?>`
    This puts `...` after each shortened title.

    If you don't want any shorten indicator after each shortened title use this:
    `<?php echo shortenContent(getAlbumTitle(), 20, ''); ?>`
  • Thanks it works and is a great improvement or feature in my eyes at least. Now each page looks the same will display the maximum amount of tiles but the data is still there.
  • Just when I thought it was working I find one of the sub albums out of the 15 where it doesn't work. I also have a problem with two of the subalbums not showing all of the folders. I will raise another topic to deal with this I think it might be a memory issue. I am trying moving things around to see the effects. Some very strange problems.
  • acrylian Administrator, Developer
    If you are using the static_html_cache plugin and are not loggedin you certainly may see an older version.

    If albums are not showing they may be unpublished unless you are loggedin when you would see all. In any case always review your error logs if you think something is strange.
  • Ok strange but I found the culprit. For that particular Album the Theme was set to something other than the gallery theme.
Sign In or Register to comment.