WordPress.org

Ready to get started?Download WordPress

Forums

NextGEN Gallery
[resolved] [closed] Is it possible to display title on gallery page (18 posts)

  1. suraj.goyal
    Member
    Posted 9 months ago #

    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.php

    Any help will be highly appreciated.
    Thanks

    http://wordpress.org/plugins/nextgen-gallery/

  2. photocrati
    Member
    Plugin Author

    Posted 9 months ago #

    @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: http://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)

  3. sdiverdan
    Member
    Posted 8 months ago #

    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?

  4. photocrati
    Member
    Plugin Author

    Posted 8 months ago #

    @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.

  5. sdiverdan
    Member
    Posted 8 months ago #

    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?

  6. VesaT
    Member
    Posted 8 months ago #

    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.

  7. photocrati
    Member
    Plugin Author

    Posted 8 months ago #

    @sdiverdan + @VesaT - Does not the !important directive keep the Custom CSS over-riding the existing NextGEN Gallery CSS in these cases?

    - Cais.

  8. VesaT
    Member
    Posted 8 months ago #

    @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.

  9. VesaT
    Member
    Posted 8 months ago #

    @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.

  10. VesaT
    Member
    Posted 8 months ago #

    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?

  11. sdiverdan
    Member
    Posted 8 months ago #

    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!

  12. photocrati
    Member
    Plugin Author

    Posted 8 months ago #

    @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.

  13. VesaT
    Member
    Posted 8 months ago #

    @photocrati - Cais, I'm savĂ­ng gallery.php into ../ngglegacy/view/. Which would be correct?

  14. photocrati
    Member
    Plugin Author

    Posted 8 months ago #

    @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.

  15. hmpk
    Member
    Posted 8 months ago #

    [ 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

  16. hmpk
    Member
    Posted 8 months ago #

    [ 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.

  17. k33f
    Member
    Posted 2 months ago #

    This was making me mad that I couldn't accomplish showing the titles in 2.0 without using a legacy template so I made a small script that displays them with ngg2.0

    Add this:

    <?php
    	// This develish little snippet is responsible for displaying the Gallery title when viewing a gallery thumbnail page
    		global $wpdb;
    		$gal_id = $displayed_gallery->container_ids;
    		$myrow = $wpdb->get_row("SELECT * FROM wp_ngg_gallery WHERE gid = $gal_id[0]");
    
    		echo '<h1 style="padding-bottom: 20px;">' . $myrow->title . '</h1>';
    	?>

    after the opening DIV tag of index.php located in /wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/templates/thumbnails

    modify as needed.

  18. esmi
    Forum Moderator
    Posted 2 months ago #

    As this resolved topic is 6 months old, I am now closing it.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic