WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: NextGEN Gallery] Gallery description text? (13 posts)

  1. Gemma Wild
    Member
    Posted 6 years ago #

    Hi Alex

    I submitted this request a few months ago on your web site but I have noticed the forums have now been removed so I thought I'd submit it here again so you don't forget =)

    When creating a gallery in the admin panel, you have the option of adding a title and description for it. But on the actual gallery page at the front end, this information isn't displayed and there doesn't seem to be a way to make it show. I'm not fussed about the title showing but I would like to include the description. Has this been implemented yet or is this something you may still be working on?

    Thanks, great plugin!

  2. Alex Rabe
    Member
    Posted 6 years ago #

    Thanks for the note, currently it's not displayed, I will have a look to make it more flexible

  3. gunderstorm
    Member
    Posted 6 years ago #

    Any update on this? I'd love to have this on my site.

  4. jowens
    Member
    Posted 5 years ago #

    I'm very interested in this as well. Would it be possible to just give us a pointer as to where to look to add the code ourselves?

  5. Alex Rabe
    Member
    Posted 5 years ago #

    Look in nggfunctions.php

  6. jowens
    Member
    Posted 5 years ago #

    Alex, thanks for the quick response.

    Here's what I did. It may not be pretty code, as I'm new to this, but it works.

    In the nggCreateGallery function, I added:

    global $wpdb;
    
    	$galleriesOfAlbum = $wpdb->get_results('SELECT * FROM '.$wpdb->nggallery.' WHERE gid ='.$galleryID, OBJECT);
     	$galleriesOfAlbum  = ngg_emulate_objekt_k($galleriesOfAlbum);
    	$gallerycontent = $galleriesOfAlbum[$galleryID];

    near the beginning, and then added:

    $out .= '<h3 class="gallerytitle">'.$gallerycontent->title.'</h3>';

    to show the title where I wanted it.

    If there is a more elegant way to do this, please let me know.

  7. Alex Rabe
    Member
    Posted 5 years ago #

    Looks good so far

  8. casparhuebinger
    Member
    Posted 5 years ago #

    Alex, where would I have to look if I'd like to use HTML within the gallery description?
    When I add br-tags as line-breaks, they get displayed just as plain text. I've been searching the code for strip_tags. Is this the right thing to look for? And where?
    Thanks a bunch!

  9. casparhuebinger
    Member
    Posted 5 years ago #

    Hey, just created a quick solution myself!
    In nggfunctions.php I added:

    $gallerycontent = $wpdb->get_row("SELECT * FROM $wpdb->nggallery WHERE gid = '$galleryID' ");
    
    $gallerydesc = nl2br($gallerycontent->galdesc);
    /*
    $gallerydesc can be used as a variable for the gallery's description.
    nl2br() enters a <br />-tag wherever a line-break has been entered
    into the Gallery Description text-field in the NGG backend.
    */
  10. casparhuebinger
    Member
    Posted 5 years ago #

    Oh, and I've replaced

    global $wpdb;

    with

    global $wpdb, $nggRewrite;

    at the top of the particular function I'm using the variable in.

    Think I got the code to display the descrip from here: http://wordpress.org/support/topic/170908?replies=6

  11. oncotton
    Member
    Posted 5 years ago #

    I have tried to follow Jowens example. all that comes up is the gallery title not the actual description. or is that all that should be displayed, how can I display the gallery description. thanks!

  12. oncotton
    Member
    Posted 5 years ago #

    I figured it out. I had to change the following from Jowens example

    $out .= '<h3 class="gallerytitle">'.$gallerycontent->title.'</h3>';

    to
    $out .= '<h3 class="gallerytitle">'.$gallerycontent-> galdesc.'</h3>';

  13. Stephane
    Member
    Posted 5 years ago #

    Can someone please tell me where do I enter the galleries' description???

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.