• Resolved terryfic

    (@terryfic)


    I’m editing the template for the basic gallery (nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/templates/thumbnails/index.php) and can’t figure out the right tag for displaying the gallery title and description. I tried this from a pretty old post:

    <h3><?php echo $gallery->title?></h3>
    <?php echo $gallery->description?>

    but nothing happens. What’s the current method, and why is this data not actually used anywhere except the admin pages?!? I’m using Version 2.1.15

    Thanks

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

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Contributor photocrati

    (@photocrati)

    @terryfic – The easiest approach to creating custom templates for the NextGEN Basic display types is to use the templates found under wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/view/ for guidelines.

    I would suggest the “captions” template as the best one to work from.

    Thanks!

    – Cais.

    Thread Starter terryfic

    (@terryfic)

    You’re misunderstanding my question. I don’t need the image captions or titles; that part I’ve figured out. It’s the GALLERY name and description I’m asking about. Can’t you simply tell me the code I’d need to pull that data? The correct php tags in the following:

    <h3><?php echo $gallery->title?></h3>
    <?php echo $gallery->description?>

    Thanks.
    Terry

    Plugin Contributor photocrati

    (@photocrati)

    @terryfic – I’m not seeing anything specifically wrong with the code you are trying to use, here it is inserted into the “captions” template as an example: https://cloudup.com/c_gvsbFPmKj

    Thanks!

    – Cais.

    Thread Starter terryfic

    (@terryfic)

    Thanks for your help! php isn’t my language (webDNA is) so I can only understand so much. I looked at your example and inserted the code on this page: /modules/nextgen_basic_gallery/templates/thumbnails/index.php and even the variable dump isn’t working. It only returns NULL, which is odd since variables must be used elsewhere on the page and of course render the thumbnails just fine. In the user interface I’m not seeing an option for a “captions” template, although I do see the file in the ngglegacy folder.

    Is it possible I need the pay version to get access to all the variables for this kind of customization?

    I suspect I need to be querying the db for the gallery record itself but like I say, I’m not a native php speaker so…

    Thread Starter terryfic

    (@terryfic)

    Here’s where I’m trying to insert this info, toward the end of the snippet. Seems like the right place to do so. I guessed at variants like <?php echo esc_attr($displayed_gallery_title)?> which didn’t return anything either:

    <!– begin NextGenGallery thumbnail template wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/templates/thumbnails/index.php –>
    <?php

    $this->start_element(‘nextgen_gallery.gallery_container’, ‘container’, $displayed_gallery);

    ?>
    <div
    class=”ngg-galleryoverview<?php if (!intval($ajax_pagination)) echo ‘ ngg-ajax-pagination-none’; ?>”
    id=”ngg-gallery-<?php echo esc_attr($displayed_gallery_id)?>-<?php echo esc_attr($current_page)?>”>

    <h3><?php echo $gallery->title; ?></h3>
    <?php echo $gallery->description; ?>

    <?php if (!empty($slideshow_link)): ?>
    <div class=”slideshowlink”>
    ‘><?php echo $slideshow_link_text ?>

    </div>
    <?php endif ?>
    ==============
    Thanks again for your help. And if I’m just a nuisance newbie, let me know and I’ll leave you alone.

    Plugin Contributor photocrati

    (@photocrati)

    @terryfic – As I noted, the best method for Basic templates is to use the NextGEN Legacy style of templates not the current NextGEN Gallery display types.

    The two different templates use two different approaches, and using the legacy method is much simpler for what you are describing.

    – Cais.

    Thread Starter terryfic

    (@terryfic)

    Thank you very much! I checked the NextGEN gallery settings page, and the option for Template was blank. I’m good to go now. Thanks again for your help.

    Plugin Contributor photocrati

    (@photocrati)

    @terryfic – Thanks for the follow-up!

    – Cais.

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Adding Gallery Titles and Descriptions’ is closed to new replies.