WordPress.org

Ready to get started?Download WordPress

Forums

NGG Video Extend
Feature request: Not show description in gallery template (10 posts)

  1. islandcastaway
    Member
    Posted 3 years ago #

    Since this plugin uses the description field as the insert, when you view a gallery that uses the description template it adds the shortcode to the page and makes it look nasty.

    It would be nice to exclude it.

    It could be done in nggallery's templates by parsing for [flv and if return=true to not show the description for the file, but could it be possible from within this plugin?

  2. Thorned Rose
    Member
    Plugin Author

    Posted 3 years ago #

    Hiya, can you confirm that this has been resolved as this issue does not occur on our test server. Thanks! :)

  3. divauno
    Member
    Posted 3 years ago #

    Yes it is resolved. But the plugin makes it where you cannot use html in the description field. I believe somehow the plugin should insert it's own field for video urls instead of using the description field.

  4. mahnie
    Member
    Posted 3 years ago #

    I totally agree. It's VERY frustrating that we can no longer use HTML in the description field!! I'm desperately trying to find a way around this ... any suggestions?

  5. mahnie
    Member
    Posted 3 years ago #

    I actually came up with an (albeit clumsy) solution to this. Here's what I did ...

    1. In the file ngg-video-extend.jss (located in the ngg video extend plugin files) I erased the following code

    $(".ngg-gallery-thumbnail span").each(function (arr){
    	var theText = $(this).text();
    	if(theText.search("[nggvid]") > -1) {
    		var theURL = theText.substring(theText.indexOf("[nggvid]")+8, theText.indexOf("[/nggvid]"));
    		var theReplacement = theText.replace("[nggvid]" + theURL + "[/nggvid]", "");
    
    		$(this).text(theReplacement);
    	}
      });

    2. In the file gallery-caption.php (located in the nextgen gallery plugin folder titled 'view') I added a class of 'details' to the span tag (I also moved the anchor tag over to encompass the span tag). So the whole ngg-gallery-thumbnail-box code looks like this

    <div id="ngg-image-<?php echo $image->pid ?>" class="ngg-gallery-thumbnail-box" <?php echo $image->style ?> >
      <div class="ngg-gallery-thumbnail" >
        <a href="<?php echo $image->imageURL ?>" title="<?php echo $image->description ?>" <?php echo $image->thumbcode ?> >
          <?php if ( !$image->hidden ) { ?>
          <img title="<?php echo $image->alttext ?>" alt="<?php echo $image->alttext ?>" src="<?php echo $image->thumbnailURL ?>" <?php echo $image->size ?> />
          <?php } ?>
          <span class="details"><?php echo $image->caption ?></span>
        </a>
      </div>
    </div>

    3. In the description of the videos I wrapped my [nggvid][/nggvid] code in a span, so the whole description looks something like

    <span>[nggvid]http://manisheriar.com/light-of-day/wp-content/uploads/video-gallery/Our-Work/the-love-of-god.mp4[/nggvid]</span>
    <h2>Bright Lights Dark City</h2>
    <h3>The rising of the sun</h3>

    4. Finally, in my theme's style sheet I add this to hide the ugly shortcode

    .ngg-gallery-thumbnail:hover span.details {
    	visibility:visible;
    }

    And that took care of it. It's a bit annoying b/c now not only do I have to have my client use the shortcode in the description (it should totally have it's own field I think), but I also have to ask him to wrap it in a div. However, I'm just happy to have a solution, and I'm SUPER grateful for this awesome plugin, small complaints aside. ;)

    FYI, for me changing the anchor tag to include the whole caption also has set up a lot more flexibility in styling. On hover over the thumbnail I can have background images and/or description text (ow with html!).

  6. divauno
    Member
    Posted 3 years ago #

    I have a better one that will make it easier for your client. I commented out all the code in the ngg-video-extend.js file (You can delete all of it if you like but I decided to comment it out) and then I insert this:

    jQuery(document).ready(function($){
    $(".ngg-gallery-thumbnail a").each(function (arr){
    if ($(this).attr("title").substr(0,5)=="Video"){
    $(this).attr("rel","shadowbox;width=405;height=340");
    $(this).attr("href",$(this).children("img").attr("title"));
    }
    })
    });

    I got this code from herehttp://blog.creonfx.com/javascript/wordpress-video-galleries-with-nextgen-and-jquery

    You can change the width and height for the shadowbox to whatever you like. But instead of wrapping the video url in [nggvid][/nggvid] and putting it into the description box you can put the video url in the title box. Put the title on the first line in the description box and it will show up above the video in the shadowbox. You can now put html in the description if needed. I can't remember if I may have done anything else... but try that and let me know if that works. I think it will be more simple for your client - I have a client using the same format with no problems.

  7. mahnie
    Member
    Posted 3 years ago #

    I was so psyched for this to work! However, when I tried it I ran into a couple of problems. First, the video player was the wrong size and no amount of changing the sizes in the above code would change that. (weird!) And secondly in order to get it to work I had to start the title out with "Video:" ... since everything in the gallery is a video it doesn't make sense to have "Video:" at the start of every description.

    Sadly I am too much of a javascript moron to know how to fix these two issues! I was feeling pretty proud of myself before for getting this all to work but now that I know someone else has come up with a more elegant solution for the client I want it!

    Any chance you can help me figure it out?

    THANKS!! :)

  8. divauno
    Member
    Posted 3 years ago #

    I think you still have to set the size in the Shadowbox JS plugin options as well to the size you want. I'm not testing this right now - but I noticed under both the code and Shadowbox JS are set to the same width and height.
    As for the Video thing try this:

    jQuery(document).ready(function($){
    $(".ngg-gallery-thumbnail a").each(function (arr){
    if ($(this).attr("title").substr(0,5)){
    $(this).attr("rel","shadowbox;width=405;height=340");
    $(this).attr("href",$(this).children("img").attr("title"));
    }
    })
    });

    I using my gallery for both images and video... however, you've got me thinking if the "Video" is necessary to use both.

  9. mahnie
    Member
    Posted 3 years ago #

    At first that didn't do the trick, but somehow after playing around a bit it's all working ... thank you so much! This is MUCH more elegant than having to post the link wrapped in [nggvid] and <span> tags!! :)

  10. divauno
    Member
    Posted 3 years ago #

    Glad to be of help!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic