New Landing How can we help? Cardinal images description in gallery lightbox

Viewing 2 posts - 1 through 2 (of 2 total)
  • Posted in: Cardinal
  • #176686
    JeffDSmith
    Member
    Post count: 31

    Hi.

    We would like to show the image description instead of the image cation in gallery lightbox. This is in order to show text with mixed with html tags like links or bold items.

    How can we change the code that controls lightbox to do that?

    Thank you!

    #176744
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please paste this code at functions.php of child theme.

    function sf_gallery_item_link($link_type, $id = 0) {
    
    			$link_config = $link_script = $item_icon = "";
    			
    			global $post, $sf_options;
    			$lightbox_nav = $sf_options['lightbox_nav'];
    			$lightbox_thumbs = $sf_options['lightbox_thumbs'];
    			$lightbox_skin = $sf_options['lightbox_skin'];
    			$lightbox_sharing = $sf_options['lightbox_sharing'];
    			
    			if ($link_type == "page") {
    				$link_config = 'href="'.get_permalink().'" class="link-to-url"';
    				$item_icon = apply_filters('sf_gallery_page_icon', "ss-navigateright");
    			} else if ($link_type == "lightbox") {
    				$gallery_images = rwmb_meta( 'sf_gallery_images', 'type=image&size=gallery-image');	
    				$link_config = 'id="gallery-'.$id.'" href="#" class="gallery-lightbox"';
    				$item_icon = apply_filters('sf_gallery_lightbox_icon', "ss-view");
    				$link_script .= "<script>jQuery(document).ready(function(){jQuery('#gallery-".$id."').click(function(){
    				var lightboxSocial = {
    						facebook: true,
    						twitter: true,
    						googleplus: true,
    						pinterest: {
    							source: 'https://pinterest.com/pin/create/bookmarklet/?url={URL}',
    							text: 'Share on Pinterest'
    						}
    					};
    					jQuery.iLightBox(
    						[";
    				foreach ( $gallery_images as $image ) {
    					$link_script .= "{
    								URL: '".$image['full_url']."',
    								type: 'image',
    								title: '".$image['title']."',
    								caption: '".$image['description']."'
    					},";
    				}		
    				$link_script .= "],
    						{";
    				if ($lightbox_skin == "dark") {
    				$link_script .= "skin: 'metro-black',";
    				} else {
    				$link_script .= "skin: 'metro-white',";
    				}
    				$link_script .= "controls: {";
    				if ($lightbox_nav == "arrows") {
    					$link_script .= "arrows: true,";
    				}
    				if (!$lightbox_thumbs) {
    					$link_script .= "thumbnail: false";
    				}
    				$link_script .= "},";
    				if ($lightbox_sharing) {
    				$link_script .= "social: {
    					buttons: lightboxSocial
    				},";
    				}
    				$link_script .= "path: 'horizontal',
    							thumbnails: {
    								maxWidth: 120,
    								maxHeight: 120
    							},
    						}
    					);
    					return false;
    				});
    				});";
    				$link_script .= "</script>";
    			}
    			
    			$item_link = array(
    				"icon" => $item_icon,
    			    "config" => $link_config,
    			    "script" => $link_script
    			);
    			
    			return $item_link;
    		}

    Thanks
    Mohammad

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register