File Upload multiple elements in one entry.
Posted: 03 July 2009 07:36 AM   [ Ignore ]  
Lab Assistant
Avatar
RankRank
Total Posts:  151
Joined  02-18-2008

Hi Guys,

I am using Mark Holts File upload to upload multiple images in the one entry which would then ce called upon by Lightview AJAX… the other uploaded images would then load as they are part of a gallery with the same entry.

The first story has 2 images… but the first one is loading for the gallery - twice.

http://www.g1digitalmedia.com.au

any ideas? my html version works fine so I am missing somelogic or code here.

cheers Lance

{exp:weblog:entries weblog="entry"}
<li>    
<
a href="{file}" class="lightview" title='{title} :: {short_caption}' rel='gallery[{title}]'>{exp:imgsizer:size src="{file}" width="360"}</a>

</
li>{/exp:weblog:entries}
 Signature 

Lance Elliott

Designer
Sydney, Australia

http://www.independentdesign.com.au

Profile
 
 
Posted: 03 July 2009 06:44 PM   [ Ignore ]   [ # 1 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  151
Joined  02-18-2008

Ok, so I have figured out I need to loop but the loop is not outputting the first image twice instrad of moving onto the second image…


Mark’s documentation says:
Variable Pairs

  * {[custom_field]}…{/[custom_field]} — When used as a pair the contained code will loop, outputting all the uploaded files.


Here file is my custom field for the image.

{exp:weblog:entries weblog="entry"}
{file}
<img src="{file}" />{/file}
<h3>{title}</h3>
{content}
{
/exp:weblog:entries}

any ideas on on this looping issue?
cheers Lance

 Signature 

Lance Elliott

Designer
Sydney, Australia

http://www.independentdesign.com.au

Profile
 
 
Posted: 03 July 2009 06:55 PM   [ Ignore ]   [ # 2 ]  
Professor
Avatar
RankRankRankRankRankRankRank
Total Posts:  10822
Joined  04-15-2006

Hiya,

Past midnight here so I might not be thinking correctly as I’m just off to bed but your code here :

{exp:weblog:entries weblog="entry"}
{file}
<img src="{file}" />{/file}
<h3>{title}</h3>
{content}
{
/exp:weblog:entries}

has {file} in there twice. Once as the opening tag of the loop as file is your custom field but then you have it inside the loop too.

I think perhaps your code should be this maybe?

{exp:weblog:entries weblog="entry"}
{file}
<img src="{file_url}" />{/file}
<h3>{title}</h3>
{content}
{
/exp:weblog:entries}

Hope that helps a bit.

Best wishes,

Mark

 Signature 

Shopping Cart Plugin
Full list of add-ons
———————————————————-
Buy me a drink, or two if you like!!

Profile
 
 
Posted: 03 July 2009 06:58 PM   [ Ignore ]   [ # 3 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  151
Joined  02-18-2008

10am here in Sydney… sunny too.

Mark, that worked a treat… thankyou. You have saved me again.

cheers Lance

 Signature 

Lance Elliott

Designer
Sydney, Australia

http://www.independentdesign.com.au

Profile
 
 
Posted: 03 July 2009 07:26 PM   [ Ignore ]   [ # 4 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  151
Joined  02-18-2008

So for the anyone interested I got Lightview AJAX and FILE plugin to work together.

{file}
<a href="{file_url}" class="lightview" title='{title} :: {short_caption}' rel='gallery[{title}]'>{exp:imgsizer:size src="{file_url}" width="360"}</a>
{/file}
 Signature 

Lance Elliott

Designer
Sydney, Australia

http://www.independentdesign.com.au

Profile
 
 
Posted: 04 July 2009 05:11 AM   [ Ignore ]   [ # 5 ]  
Professor
Avatar
RankRankRankRankRankRankRank
Total Posts:  10822
Joined  04-15-2006
lance72 - 03 July 2009 06:58 PM

10am here in Sydney… sunny too.

Muggy here. We’ve had all our sun for the week and now we are going to get the rain :-(

lance72 - 03 July 2009 06:58 PM

Mark, that worked a treat… thankyou. You have saved me again.

cheers Lance

No problems, any time.

Best wishes,

Mark

 Signature 

Shopping Cart Plugin
Full list of add-ons
———————————————————-
Buy me a drink, or two if you like!!

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1743, on December 02, 2009 03:47 PM
Total Registered Members: 120275 Total Logged-in Users: 61
Total Topics: 126399 Total Anonymous Users: 19
Total Replies: 664735 Total Guests: 296
Total Posts: 791134    
Members ( View Memberlist )