Yii Framework Forum: [Extension] jqPrettyPhoto - Yii Framework Forum

Jump to content

  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

[Extension] jqPrettyPhoto jqprettyphoto extension Rate Topic: -----

#21 User is offline   bennouna 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 1,165
  • Joined: 05-January 12
  • Location:Morocco

Posted 23 March 2012 - 09:02 AM

I believe the extension doesn't "see" the images in your subsequent pages.

I haven't used it with CListView, but I did use it with dynamically generated content. This post from sieppl helped me.
0

#22 User is offline   ichigo 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 9
  • Joined: 08-August 11

Posted 23 March 2012 - 09:25 AM

View Postbennouna, on 23 March 2012 - 09:02 AM, said:

I believe the extension doesn't "see" the images in your subsequent pages.

I haven't used it with CListView, but I did use it with dynamically generated content. This post from sieppl helped me.


Thanks Bennouna, it is working now, i use the sieppl method. Have a nice weekend :)
0

#23 User is offline   Кукурузник 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 22-February 12
  • Location:Moldova

Posted 22 October 2012 - 10:12 AM

First, I will say thank you for the extension! Saves a lot of time!
I had a problem with a few galleries in one page.
I added a galleries as follows:
<?php foreach ($model as $gallery) :?>
  	<div class="galleryPhotos-<?php echo $gallery->id; ?>">
            <?php
            $photos = $gallery->galleryBehavior->getGalleryPhotos();
                foreach ($photos as $item) echo CHtml::link (CHtml::image($item->getUrl('thumb'),'',array ('class'=> 'imgb_g','style'=>'margin:5px;')),$item->getUrl());
            jqPrettyPhoto::addPretty('.galleryPhotos-'.$gallery->id.' a',jqPrettyPhoto::PRETTY_GALLERY,jqPrettyPhoto::THEME_DEFAULT, $options);
            ?>
            
        </div>
</div>
<?php endforeach; ?>


But unfortunately only worked last gallery. :(

To ensure that all was well, I made the following changes to jqPrettyPhoto.php
	public static function addPretty($jsSelector=".gallery a", $gallery=self::PRETTY_GALLERY, $theme=self::THEME_DEFAULT, $opts=array()){
		
		self::registerScript();
		
		$opts['theme']=$theme;
		
		
		Yii::app()->clientScript->registerScript($jsSelector,'
			$("'.$jsSelector.'").attr("rel","prettyPhoto'.($gallery==self::PRETTY_GALLERY?'['.uniqid().']':'').'");
			$("a[rel^=\'prettyPhoto\']").prettyPhoto('.CJavaScript::encode($opts).');
		',CClientScript::POS_READY);
	}


Hope this will help someone!
(If I made a mistake somewhere - enter, I want to know)
0

#24 User is offline   U4EA 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 133
  • Joined: 04-November 12

Posted 14 March 2013 - 04:49 AM

Can I ask what the best method is to use to get an array of images to iterate with this extension?
0

Share this topic:


  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users