Is it possible to display title on gallery page
-
Hi,
Is is possible to display gallery title on gallery page where list of picture thumbnails are shown. I am using :
Display type = Basic Compact Album
Display Gallery as = Basic Thumbnails
Template = Album-compact.phpAny help will be highly appreciated.
Thanks
-
@suraj.goyal – The only way to do this would be to link your galleries to pages where you have inserted the gallery.
1) Page >> Add New > give page the title of your gallery > follow these steps to add your gallery to the page: https://www.nextgen-gallery.com/adding-galleries/ > publish
2) Go to Gallery > Manage Galleries > [select gallery] > there should be a setting called ‘page link to’, select in dropdown the page you just created for the gallery > save changes.Now when you visit your album and click on the gallery it should take you to the page with the gallery and the title should appear on the page. ??
Hope that helps! (Becky)
what do you mean, create a page for every gallery! If you have 50 galleries you want WordPress administrators to create 50 more webpages!
What happened to the <?php echo $gallery->title ?> insert into the gallery.php.
How come there is not a one line code solution versus adding a page for every gallery?
@suraj.goyal + @sdiverdan – There is also the option of creating a custom template to add the gallery title to the display but this option (without creating the new page as suggested above) would then be the default setting for all future Basic Thumbnail Gallery displays to sort out what I understand as Suraj’s idea.
First, create the custom template; add/modify the code accordingly. Next set the default Basic Thumbnails to use the custom template then carry on.
Have a look at the templates here:
/products/photocrati_nextgen/modules/ngglegacy/view/gallery.php
Just make a copy (give it a different name), modify it, and save it to the same place.
– Cais.
thanks Cais, I copied the gallery.php file with a new name and added the <?php echo $gallery->title ?> into the new php. This works! The title is now on my gallery webpage!
The only downside so far is that the custom css changes I made to Nextgen Gallery is no longer applicable for that template. As an example I had:
“.ngg-gallery-thumbnail img:hover {
background-color: #xxxxxx;}”
but I found nextgen_basic_thumnails.css in “wp-content\plugins\nextgen-gallery\products\photocrati_nextgen\modules\nextgen_basic_gallery\static\thumbnails” had the statement:
“.ngg-gallery-thumbnail img:hover {
background-color: #A9A9A9;}”
It wasn’t overwritten! Any idea how the new template follows the css custom changes?There has been a problem displaying gallery thumbnails with custom CSS ever since that was introduced in NGG 2.0.xx and it still remaing with the latest public beta (2.0.37 Beta).
If you look at a gallery by selecting it within an album (album -> select any gallery, and gallery shown as default in thumbnails), the display goes back to NGG gallery thumbnail default, not the custom CSS you may have created.
As a temporary fix you can edit Basic gallery thumbnail CSS file and insert your own CSS there. That will guarantee your thumbnails will always show in your own edited. I’ve distributed this temporary fix in another thread, but for easier edits here just: the file is ../photocrati/modules/nextgen_basic_gallery/thumbnails/static/nextgen_basic_thumbnails.css). Make a copy of the original as NGG updates will override the file.
@sdiverdan + @vesat – Does not the
!important
directive keep the Custom CSS over-riding the existing NextGEN Gallery CSS in these cases?– Cais.
@photocrati – thanks for the !important reminder, Cais!
It really seemed to do the trick I’ve been missing for a long time. Inserted this directive to every CSS property changed using NGG’s Options–> Styles and now also the galleries displayed as a result of selecting one of them from e.g. Basic album display seem to work.
You should include this in Styles documentation – or automatically somehow doing the same within NGG.
@photocrati – thanks for the !important reminder, Cais!
It really seemed to do the trick I’ve been missing for a long time. Inserted this directive to every CSS property changed using NGG’s Options–> Styles and now also the galleries displayed as a result of selecting one of them from e.g. Basic album display seem to work.
You should include this in Styles documentation – or automatically somehow doing the same within NGG.
But, the insert to gallery.php does not seem to work even though I think I’m inserting at a right place:
<?php if (!defined ('ABSPATH')) die ('No direct access allowed'); ?><?php if (!empty ($gallery)) : ?> <div class="ngg-galleryoverview" id="<?php echo $gallery->anchor ?>"> <p><H3>Gallery: <?php echo $gallery->title ?></H3></p> <!-----------------show Gallery Title--------------------> <?php if ($gallery->show_slideshow) { ?>
Any thoughts?
I had to patch “products\photocrati_nextgen\modules\nextgen_basic_gallery\static\thumbnails\nextgen_basic_thumbnails.css”. I took the patch out and added the !important to the line in my custom .css. It work!
@sdiverdan – I’m happy to see adding the directive made it possible for you to revert your “patch”
@vesat – That looks correct as far as I can see … here is a lightly tested template that works on my test sites: https://gist.github.com/Cais/7564864
Are you saving your template(s) in one of the following locations:
/wp-content/themes/[yourtheme]/nggallery/
… or …
/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/view/
– Cais.
@photocrati – Cais, I’m savíng gallery.php into ../ngglegacy/view/. Which would be correct?
@vesat – Yes, as noted above … do you see your template in the drop-down selector? I would recommend giving the customized template a unique name and preserving the default (although that should not affect the output).
– Cais.
[ nggallery id=1 template=caption ]
I inserted this (without the spaces) to the Gallery page but it doesn’t work.
I am trying to add captions to be printed under the images
[ nggallery id=1 template=caption ]
I inserted this (without the spaces) to the Gallery page but it doesn’t work.
I am trying to add captions to be printed under the images
There are not enough instructions to be able to get this to work.
- The topic ‘Is it possible to display title on gallery page’ is closed to new replies.