簡體   English   中英

將Slimbox與Virtuemart 2,Joomla 2.5集成

[英]Slimbox integration with Virtuemart 2, Joomla 2.5

我正在嘗試將默認的燈箱'modal'替換為'slimbox',因為'modal'沒有導航箭頭。

帶有導航的slimbox演示

不帶導航的模態演示

我正在使用這些路徑來修改slimbox的調用

[模板名稱] /html/com_virtuemart/productdetails/default.php組件/com_virtuemart/productdetails/default.php

Joomla v2.5 Virtuemart 2.0.6 Slimbox2

以下是我的嘗試:

        //Enable Slimbox2 plugin
        $front = JURI::root(true).'/components/com_virtuemart/assets/';
        $document = JFactory::getDocument();
        $document->addStyleSheet($front.'js/slimbox/slimbox.css');
        $document->addScript($front.'js/slimbox/slimbox2.js');      
        $js = 'jQuery(document).ready(function($) { $("a.lightbox").slimbox(); });';
        $document->addScriptDeclaration($js);
        //output thumbnail
        echo $this->product->images[0]->displayMediaThumb('class="product-image"',true,'class="lightbox" rel="lightbox"'.$this->product->virtuemart_product_id.'"',true,true);
        //unset first image not to be show amont additional ones
        unset ($this->product->images[0]);
        ?>

但是它仍然無法正常工作,我想知道這是怎么回事?

[參考] [3]

您不是將slimbox類應用於圖像引用,不是將其應用於圖像容器嗎? 我認為您需要直接處理圖片文件的網址。

// get the file_url of the first image
$imgPath = $this->product->images[0]->file_url;

// output the image
<a class="slimbox" href="<?php echo $imgPath; ?>">
<img src="<?php echo $imgPath; ?>" alt="" />
</a>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM