I am sorry if I am missing something obvious but I don't see any documentation how to show the list in .php.tpl file. If someone can direct me to a resource I would appreciate it.

Thanks,
Steve

Comments

jpetso’s picture

Status: Active » Postponed (maintainer needs more info)

With "the list" I guess you mean the list of files in the node view? If I'm not mistaken, that should be a member variable of the rendered $node object - you could include a

  print '<pre>' . print_r($node, TRUE) . '</pre>';

in your .tpl.php file and pick the right variable from there. As for documentation, I believe there is none (except for previous support requests and various snippets on drupal.org maybe).

Does that answer your question?

skessler’s picture

I did that I can not find whats wrong with this code?

print $field_article_pdf[6]

I am trying do

<a href="<?php print $field_article_pdf[6] ?>" target="new"> <?php print $title ?> </a>

in the long run. Any help is much appreciated.

Thanks,
Steve

bchoc’s picture

There is no [6] in that array. It is an array with an array in it.

skessler’s picture

Thanks Brian, I did not know there could be an array in an array. The first array index is [0] the second index can be referenced with the name of the index [filepath]

<a href="http://www.yoursite.org/<?php print $field_article_pdf[0][filepath] ?>" target="new"> <? print $title ?> </a>

Please note that in this example $field_article_pdf is the name I chose for the filed when I added it to my node type.

If I was going to write documentation for this module how would I go about doing that?

Thanks,
Steve

jpetso’s picture

Category: support » task
Status: Postponed (maintainer needs more info) » Active

I guess the most useful way would be to create a FileField handbook where information like that should go in the future. So I just created one... but without real contents yet. The only thing that we now need is content - if you're going to help out with documentation, just write up a generic use case (say, yours) and solution in a few nice sentences, I can then copy that to the appropriate handbook page.

Thanks for your involvement, maybe FileField can finally get some proper documentation soon :)

Also mind that string keys for arrays should be enclosed in quotes, like $field_article_pdf[0]['filepath']. PHP also works without those quotes, but that's ugly and one of the more despisable features of that language.

dopry’s picture

Title: Where is the documentation » Where is the documentation?
Version: 5.x-2.3-rc3 » 5.x-2.3-rc4
dopry’s picture

Status: Active » Closed (fixed)

The documentation link has been added to the project description.

skessler’s picture

I see where the document is to edit but where do go to edit the node.

Thanks,
Steve