emo Group Images for Lightbox

More
10 years 1 month ago #680

But now images have group id. Example for Slimbox:

<a href="/thumbnail/images/sampledata/fruitshop/apple.jpg" class="thumbnail zoomin" style="" rel="lightbox-6" title="Apple"><img src="/thumbnail/images/thumbnails/images/sampledata/fruitshop/apple-fit-218x163.jpg" alt="Яблоки" class="" style="" height="163" width="218"></a>

Please Log in or Create an account to join the conversation.

More
10 years 1 month ago #681

Just switched to Slimbox, and yes there is a "rel" tag now.
But can we change the Value for our Images manually?

Checking on my Site with Slimbox, opening a Blog View with many Articles, Slimbox pops up with 28 Images in Line, all having the same group ID..

For Example, if you run a Website about different Fruits, I would like to set group ID's to Images with the same Fruit, like "Apple" & "Pears"

Please Log in or Create an account to join the conversation.

More
10 years 1 month ago #684

Give me link to your site.

Please Log in or Create an account to join the conversation.

More
10 years 1 month ago #685

You can check an example here:

2015.schoenruh.com/de/zimmer/zimmer-suiten

Rooms are grouped into Tabs, and the Lightbox shifts through all Rooms which is confusing,
so I would like to group Images "room1", "room2" , "room3", ...

Please Log in or Create an account to join the conversation.

More
10 years 1 month ago #686

It's not blog of articles, it's one article. So plugin groups all images to one group.
You can change it in your template.
1. Set attribute data-group="<group id>" for images
2. Copy files from plugins/content/mavikthumbnails/tmpl
to templates/<your template>/html/plg_content_mavikthumbnails
3. Edit file templates/<your template>/html/plg_content_mavikthumbnails/magnific.php:
replace
$html .= '<a href="'.$this->info->original->url.'" class="'.$class.' zoomin magnific-popup-'.$this->plugin->item->id.'" style="'.$this->linkStyle.'" title="'.$this->image->getAttribute('alt').'">';
to
$groupId = $this->image->getAttribute('data-group');
$html .= '<a href="'.$this->info->original->url.'" class="'.$class.' zoomin magnific-popup-'.$groupId.'" style="'.$this->linkStyle.'" title="'.$this->image->getAttribute('alt').'">';

Please Log in or Create an account to join the conversation.

More
10 years 1 month ago #687

Thank you. The Data-Group is now added to the Class of the <a> Tag, but
unfortunatly the Javascript is not working anymore thor those Images.
So I changed

$html .= '<a href="'.$this->info->original->url.'" class="'.$class.' zoomin magnific-popup-'.$this->plugin->item->id.'" style="'.$this->linkStyle.'" title="'.$this->image->getAttribute('alt').'">';
to
if ($this->image->getAttribute('data-group') == '') {
		$groupId = $this->plugin->item->id;
	}
	else {
		$groupId = $this->image->getAttribute('data-group');
	}
    $html  .= '<a href="'.$this->info->original->url.'" class="'.$class.' zoomin magnific-popup-'.$groupId.'" style="'.$this->linkStyle.'" title="'.$this->image->getAttribute('alt').'">';

Looking at your Code at DecoratorMagnific.php, I might have to change something there as well for the Magnific Code to work:
/**
     * Action for each item
     */
    public function item()
    {
        if(!$this->headerAdded) { return; }

        if (!isset($this->plugin->item->id)) {
            $this->plugin->item->id = uniqid();
        }
        $document = \JFactory::getDocument();
		$class = 'magnific-popup-'.$this->plugin->item->id;
		$document->addScriptDeclaration("
            jQuery(document).ready(
                function(){
                    jQuery('.{$class}').magnificPopup({
                        type:'image',
                        gallery: {
                            enabled:true,
                            preload: [1,2]
                        }
                    });
                }
            )
        ");
    }

But changing $class = 'magnific-popup-'.$this->plugin->item->id;
to
if ($this->image->getAttribute('data-group') == '') {
			$class = 'magnific-popup-'.$this->image->getAttribute('data-group');
		}
		else {
			
			$class = 'magnific-popup-'.$this->plugin->item->id;
		}

Results in a Server Error Notice: Undefined property: Plugin\Content\MavikThumbnails\DecoratorMagnific::$image in D:\xampp\htdocs\schoenruh\plugins\content\mavikthumbnails\decorators\popups\magnific\DecoratorMagnific.php on line 57

Please Log in or Create an account to join the conversation.

Time to create page: 0.035 seconds
Powered by Kunena Forum