Jump to content

Select specific files for download from array


electricarts
 Share

Recommended Posts

Hi,

for a download page i need some links to files, which don't stay together in a "ul". They are distributed all over the page. I was wondering (and hoping) that there's a solution like the one for images: 

<?php $image = $page->images->eq(0);
			if($image) echo "<img src='$image->url'>";
			?>

But i can't find something about it and a quick test didn't work. It worked for one single download: 

<?php $file = $page->download_files->eq(0);
			if($file) echo "<a href='$file->url'>$file->description</a>";
			?>

When trying to address the 2nd file in the array with "eq(1)" nothing happens. What can i do to select the a specific file from the array? 

Mario

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...