Dear Eaton,
I´m trying to use insert view with custom node types and a custom node.tpl.php. But i have no success.
My code for part of the tpl is:
<h4 class="colhead"><?php print t($node->field_body_title[0]['view']).' '; ?></h4>
<?php print $node->content['body']['#value'] ?><br> <br>
<?php if (count($taxonomy)): ?>
<div class="taxonomy"><?php print t(' in ') . $terms ?></div>
<?php endif; ?>
</div>
But insert view tags are always shown as plain text. I tryed to solve it like this:
<?php print _insert_view_substitute_tags($node, 'body') ?>
But then it shows all fields of the $node->body instate only the value for the field_body. All the other filters are working only insert view is not.
I think it is because of the funktion insert_view_substitute_tags.
Any Idea
Thanks Dirk
Comments
Comment #1
mlsamuelson commentedHi Dirk,
Correct me if I'm mistaken, but it sounds like you're attempting to apply Insert Views code at the tpl level, rather than as tags entered into the node's form. Am I correct?
All you have to do is key in the tag [view:NameOfView] and that view will appear in the node. There's more info on how to do this in the README.txt file, and in the filter tips in the "input filters" section of the node edit page.
mlsamuelson
Comment #2
designwork commentedHi mlsamuelson,
no i tryed to put the view tag in the node. Just because it is not working with my tpl files i tryed to print the view tag with
<?php print _insert_view_substitute_tags($node, 'body') ?>.But i solved the problem by rewriting the module. The problem was the funktion _insert_view_nodeapi. Now i changed it and it works fine.
Dirk
PS now it will work for any theme with any field CCK you print out in your theme not only with the body variable.
Comment #3
mlsamuelson commentedIf you'd like to submit your rewrite as a patch, we'd love to review it for potential inclusion in the current module.
mlsamuelson
Comment #4
designwork commentedHi mlsamuelson,
how to submit?
Dirk
Comment #5
mlsamuelson commentedYou can submit a patch here in this issue thread. Simply attach it as a file.
More info on patches can be found at http://drupal.org/patch .
mlsamuelson
Comment #6
erikhopp commentedI'm pretty sure this is the same issue and I provided a patch that is hopefully moving in the right direction: http://drupal.org/node/170921#comment-309074
Erik.
Comment #7
designwork commentedHi erikhop,
yes you are rigth, its the same problem. Thanks for the patch. I had no time to do it.
Dirk
Comment #8
mlsamuelson commentedSee http://drupal.org/node/170921#comment-621627
Marking this one as a duplicate.