electricarts Posted May 12, 2016 Share Posted May 12, 2016 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 More sharing options...
LostKobrakai Posted May 12, 2016 Share Posted May 12, 2016 eq() is exactly the things to use in this kind of situation. I'm not sure why it's not working for you. Link to comment Share on other sites More sharing options...
ottogal Posted May 12, 2016 Share Posted May 12, 2016 Are you sure your field download_files has a Maximum files allowed value greater than 1? Link to comment Share on other sites More sharing options...
electricarts Posted May 12, 2016 Author Share Posted May 12, 2016 The Maximum files allowed is set to "0" (No limit). Link to comment Share on other sites More sharing options...
electricarts Posted May 12, 2016 Author Share Posted May 12, 2016 Ahhh, my fault. Of course. The description for that file was empty in the backend. So, nothing to klick in the frontend. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now