getProjectFiles() in project_view template

boonier's Avatar

boonier

24 Oct, 2012 10:38 AM

Hi

Using the example code, why does this not appear to work in the project_view template? When I echo this

<?php $files= getProjectFiles( $id ); echo $files; ?>

it returns an array, and equally:

<?php 
    $files= getProjectFiles( $id ); 
    foreach ( $files as $id => $data ) 
    { 
        echo $data['title']; 
    } 
?>

yields nothing in this template, though it works in the list view. Am I missing something or misunderstanding this function?

thanks

  1. Support Staff 1 Posted by Mikael on 01 Nov, 2012 06:22 PM

    Mikael's Avatar

    It could be that $id is not defined?

  2. 2 Posted by kaj on 02 Feb, 2014 09:23 PM

    kaj's Avatar

    Hi Mikael

    Im stuck at this point too.
    I want to get all the Images of a Project with getProjectFiles,
    but nothing shows up.

    <?php
    $files= getProjectFiles( $id ); foreach ( $files as $id => $data ) { echo $data['file']; } ?>

  3. 3 Posted by kaj on 02 Feb, 2014 10:53 PM

    kaj's Avatar

    (basically, what i wanna do is use another slideshow. and what i need is:

    ..and so on, like you get it in the cycle slideshow. but how do i get this?)
  4. 4 Posted by kaj on 02 Feb, 2014 10:54 PM

    kaj's Avatar

    (basically, what i wanna do is use another slideshow. and what i need is: div class="file">

    ..and so on, like you get it in the cycle slideshow. but how do i get this?)
  5. 5 Posted by kaj on 02 Feb, 2014 10:56 PM

    kaj's Avatar

    (basically, what i wanna do is use another slideshow. and what i need is:

    ...and so on, like you get it in the cycle slideshow. but how do i get this?)
  6. 6 Posted by kaj on 02 Feb, 2014 10:57 PM

    kaj's Avatar

    (basically, what i wanna do is use another slideshow. and what i need is: div class="file" img src="http://dev.domain.com/cms/files/projects/first-project/abcdefg.jpg&...; width="x" height="y" alt="" / /div ...and so on, like you get it in the cycle slideshow. but how do i get this?)

  7. 7 Posted by kaj on 02 Feb, 2014 11:43 PM

    kaj's Avatar

    hey, i got it, thx anyway!

  8. 8 Posted by kaj on 02 Feb, 2014 11:44 PM

    kaj's Avatar

    (id was not defined. ;-)

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac