Hi there,

Trying to insert a ddblock into a node template (node.tpl.php) file. It doesn't seem to work using:

<?php
$block = module_invoke('ddblock', 'block', 'view','3');
print $block['content'];
?>

Do you know how I can do this? Thanks a lot for a great module.

Comments

ppblaauw’s picture

Status: Active » Postponed (maintainer needs more info)

The code is good.
Where did you put it in the node.tpl.php?

Just before or after the line:

print $content

When you put it in the node.tpl.php it would be shown in all nodes
Probably you want to put it in node-[***content-type-name***].tpl.php

to show it only in nodes of that content type

Can you attach your complete node.tpl.php file and can you send a link to the site.

Hope this helps you further, please let me know.

adshill’s picture

I removed $content as I needed to seperate body and title text. Unfortunately I can't give a link to the site as its just local at the moment.

The tpl file is already a specific node-type file. Something does appear but it is the images as 55px and they don't actually appear - just white spaces of 55px square in a row. The block should be 700px wide... It works fine when I put the snippet in a node body but I need this to be above all node content.

The code that it is generating is like this:

<!-- block content. -->
<div id="ddblock-3" class="ddblock-contents clear-block" style="visibility:hidden">
 <div class="ddblock-content clear-block">
     <div class="ddblock-container"> 
               <img src="/xxxxxxx/sites/default/files/images/ddblock/corporate/handshake.png" alt="" width="55px" height="55px" />
           <img src="/xxxxxxx/sites/default/files/images/ddblock/corporate/hotel.png" alt="" width="55px" height="55px" />
           <img src="/xxxxxxx/sites/default/files/images/ddblock/corporate/intercitytrain.png" alt="" width="55px" height="55px" />
           <img src="/xxxxxxx/sites/default/files/images/ddblock/corporate/plane.png" alt="" width="55px" height="55px" />
           <img src="/xxxxxxx/sites/default/files/images/ddblock/corporate/thecar.png" alt="" width="55px" height="55px" />
           <img src="/xxxxxxx/sites/default/files/images/ddblock/corporate/train.png" alt="" width="55px" height="55px" />
         
        </div>
    
  
   </div>
</div>

The tpl content is:

<?php
$block = module_invoke('ddblock', 'block', 'view','3');
print $block['content'];
?>

<div id="content_body">
<?php if ($page == 0) { ?><h2 class="title"><a href="<?php print $node_url?>"><?php print $title?></a></h2><?php }; ?>
    <?php if ($page == 1) { ?><h2 class="title"><?php print $title?></h2><?php }; ?>

    <?php if ($submitted) { ?><span class="submitted"><?php print $submitted?></span><br/><br/><?php }; ?>
    <!-- <div class="taxonomy"><?php print $terms?></div> -->

<?php print $node->content['body']['#value'] ?>

<?php if ($links) { ?><div class="links">&raquo; <?php print $links?></div><?php }; ?>
<br/><br/>
<a rel="lightframe[|width:550px; height:400px; scrolling: auto;]" href="/xxxxxxxxx/node/44/lightbox2"><img src="/misc/contact_corporate.png" alt="Contact Corporate Travel Team Now"/></a>
</div>

<div id="right-column">
	<?php print $node->field_right_column[0]['view'] ?>
</div>

Thanks a lot for your help.

Adam

ppblaauw’s picture

Title: Inserting into a node template file » Inserting into a node template file for basic ddblock slideshow

I see now you use the basic options of the ddblock slideshow:

Maybe your content container setting in the ddblock config page is not correct.

Have a look at the faq question: I see only very small thumbnails and sometime the big images, what is wrong?

hope this helps you further, please let me know.

adshill’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

Thanks for the info although I found this wasn't the problem - it was actually that I had the same ddblock in a block, but with my debugging I had used css to hide it. When I removed this block in the block settings everything was fine :)

Thanks,

Adam