• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Fudging multi-image upload with GBFilePicker and ListIt2
PostPosted: Thu Jun 26, 2014 8:38 am 
Offline
Power Poster
Power Poster

Joined: Sat Jan 22, 2005 11:19 am
Posts: 463
By default, the LI2 field definition type GBFilePicker only allows you select one image BUT, if you don't delete the previous image AND each pic has a different name, the image files remain in the directory.

Here's what I did...

1. Create a GBFilePicker field definition in my custom LI2 instance
2. Uploaded a number of images
3. Selected one of the images from the dropdown in the admin LI2 item edit area. This saves the image path.

Then in the template put:
\$1:
   {assign var='path' value='uploads/images/press/'|cat:$item->item_id|cat:'/*.*'}   
   {assign var='images' value=$path|glob}
   
   <div class="gallery">
      <ul class="clearing-thumbs" data-clearing>
         {foreach from=$images item=image}
            <li><a href="{$image|escape:'url'|replace:'%2F':'/'}"><img src="{CGSmartImage src=$image|escape:'url'|replace:'%2F':'/' notag=1 width=200}" data-caption="{$item->title}"></a></li>
         {/foreach}
      </ul>
   </div>


What this does is collect all the images in the directory associated with the item id and, in this case with CGSmartImage, outputs the thumbnails.

You could get clever and create a module_custom template to show all the thumbnails in the admin item edit screen but didn't need it so didn't go there.

Have fun with it.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
A2 Hosting