So, I'm not that familiar with Tapestry (just took a quick glance at it) but I guess my first question is, why wouldn't you create your own node.tpl.php file (just copy the default and place it in your theme) then, from there, create a node-[custom].tpl.php and use the method shown in the podcast?
I suppose I'm lost as to why you're trying to do it differently. Also, what's the file you pasted the code for here? You'll see in it's notes that $node is available there, which means you can follow the same procedure as usual.
Help me understand the problem better...
Hi Rob
Thanks for your assist. Yes, good questions. Originally I did solve this issue by importing a basic node.tpl.php and it worked for the purpose of swf tools. But it nobbled another module: admin hover, which its project page reports currently has a dependency on certain forms of node template.
So, I go back to FileField module to find out how it normally themes and I get reading the Advanced Help for the CCK module and it is there that it advices on using a content-field-tpl.php to theme file fields. Cool I think, now I can get the best of both worlds.
So I try to theme this template file in v. similar fashion to the node template which I've edited in accordance with Mustard Seed podcast on swftools. But no show. Hence my query here.
(Fact is, I'm new to php. CSS I can do, but php goes over my head right now and this is the first time I've looked inside a php file and tried to understand it.)
Hope this help in where I'm coming from. The template file inserted is carried over straight from CCK, as instructed in the CCK Advanced Help...
Appreciate your interest. I could go back to jQuery media as another option: I mainly require audio for the website I'm constructing, but when Mustard Seed said SWFTools was the way to go, i took that onboard.
I've installed file-field module and swf tools, following the excellent mustard seed podcast about the same elements. However, I'm utilising Tapestry theme which doesn't have node.tpl.php or play nicely with it and associated content-type.tpl.php (it breaks admin_hover which I use for a start). Although I did get the 1 pixel out player to work by this method.
Thus, I'm trying to theme using the same principles applied to the File Field, also referring to the CCK Advanced Help files.
Thus, I've taken the instrumental part:
<?php print $item['view'] ?>and rethemed it:<?php print swf($item['filepath']); ?>(the full content-field-audio_field.tpl.php file is reproduced below).
It's not showing up. Does anyone have experience theming with File Field and can point me in the right direction?
Many thanks.
<?php
// $Id: content-field.tpl.php,v 1.1.2.5 2008/11/03 12:46:27 yched Exp $
/**
* @file content-field.tpl.php
* Default theme implementation to display the value of a field.
*
* Available variables:
* - $node: The node object.
* - $field: The field array.
* - $items: An array of values for each item in the field array.
* - $teaser: Whether this is displayed as a teaser.
* - $page: Whether this is displayed as a page.
* - $field_name: The field name.
* - $field_type: The field type.
* - $field_name_css: The css-compatible field name.
* - $field_type_css: The css-compatible field type.
* - $label: The item label.
* - $label_display: Position of label display, inline, above, or hidden.
* - $field_empty: Whether the field has any valid value.
*
* Each $item in $items contains:
* - 'view' - the themed view for that item
*
* @see template_preprocess_field()
*/
?>
<?php if (!$field_empty) : ?>
<div class="field audio-field-<?php print $field_type_css ?> field-<?php print $field_name_css ?>">
<?php if ($label_display == 'above') : ?>
<div class="field-label"><?php print t($label) ?>: </div>
<?php endif;?>
<div class="field-items">
<?php $count = 1;
foreach ($items as $delta => $item) :
if (!$item['empty']) : ?>
<div class="field-item <?php print ($count % 2 ? 'odd' : 'even') ?>">
<?php if ($label_display == 'inline') { ?>
<div class="field-label-inline<?php print($delta ? '' : '-first')?>">
<?php print t($label) ?>: </div>
<?php } ?>
<?php print $item['view'] ?>
<?php print swf($item['filepath']); ?>
</div>
<?php $count++;
endif;
endforeach;?>
</div>
</div>
<?php endif; ?>
shalom,
John