By mikou on
Hello,
First of all, I am not sure my small script has its place in this part of the forum. But it deals about a theming problem and it is some coding...
I wondered if somebody could help to understand why I can't get the "title" field of my view in my script. I did as follow :
- A view : "labels", containing :
-
2 fields
- node:title
- node:body
- a style
- HTML List
- A template file : views-view-list--labels containing the following code :
<div class="item-list">
<?php drupal_add_js('misc/collapse.js'); ?>
<?php foreach ($rows as $id => $row): ?>
<fieldset class="<?php print $classes[$id]; ?> collapsible collapsed">
<legend>
test
</legend>
<div class="fieldset-wrapper">
<?php print $row ?>
<?php print $options['type'] ?>
</div>
</fieldset>
<?php endforeach; ?>
</div>
$options['type'] returns me the HTML tag (ul or li). $node->$title doesn't work.
I simply can't find how to get the title of the displayed fields in my view. However I get all of them in one single output through $row. Somebody do understand ?!
thanks
I just add a quick lick to the example page : http://www.management-consult.fr/. If it can help to clear up
Comments
$node->$title ... This won't
$node->$title ... This won't work, your syntax is incorrect. Ooops! $node->title (not $node->$title).
In a view, not a node
Hi, thanks for your answer. It didn't worked.
I think it might be because I am displaying view fields and not a node. What do you think ?!