2012-05-07 10 views
0

'modal'にはナビゲーション矢印がないため、デフォルトのライトボックス 'modal'を 'slimbox'に置き換えようとしています。SlimboxとVirtuemart 2、Joomla 2.5との統合

Demo of slimbox with navigations

Demo of modal without navigations

私は コンポーネント/ com_virtuemart/productdetails /デフォルト/html/com_virtuemart/productdetails/default.php [TEMPLATENAME] slimbox

の呼び出しを修正するためにこれらのパスを使用しています.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]

答えて

0

あなたはあなたのイメージのコンテナにそれを適用し、画像の参照にslimboxクラスを適用されていませんが、あなたではありませんか?私の意見では、画像ファイルのURLを直接処理する必要があります。

// 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> 
関連する問題