What is the code for including Disqus in a custom theme, that dows not output any "drupal content"?

Comments

robloach’s picture

Status: Active » Postponed (maintainer needs more info)

You'd have to update to the development snapshot, and choose to output Disqus as a variable ;-) . Let me know if it works and I'll make a 1.7 release.

espenmoe’s picture

How do i insert the variable?

I can't find any documentation.

is this the one?

http://drupal.org/node/580900#comment-2092008

robloach’s picture

In your node tpl file, you should be able to use:

  echo $node->disqus_comments;

You'd need Disqus 6.x-1.x-dev though. If you report success, then I'll make a 1.7 release.

espenmoe’s picture

Version: 6.x-1.6 » 6.x-1.x-dev

As far as I can see (quick testing), it does pull out the Disqus comment form.

You can see for yourself here:
http://beta.journalisten.no/story/62420

thepaul’s picture

Can't get this to work in a custom theme.

<?php
  echo $node->disqus_comments;
?>

That code in the node.tpl results in nothing being output. I did upgrade to the 6.x-1x-dev version.

robloach’s picture

Did you change it to Variable output in the configuration settings? Try this:

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

It should be in there somewhere.

thepaul’s picture

Thanks for the quick response Rob, I ran print_r and see the following:

[disqus_comments] =>

But nothing outputs...

... the comments aren't even showing when I try to display them as a block so I probably have bigger problems.

carlhinton’s picture

Same problem here - what is really needed is for the function render($values) found in disqus.views.inc to be converted so that it outputs to .tpl.php files - this would give themers complete control over the comment output. We have a particularly difficult accessibility problem as some of our comments are in Arabic and others in English. We need to tell the CSS whether to align right / left and apend language identifiers at appropriate points.

futbol724’s picture

This is the first time I work on my own custom theme for a content-type and #6 definitely works. You just have to set the module to use INJECTED VARIABLE (in /admin/settings/disqus/general) and then place the variable in your custom template file wherever you want the comments displayed.

Such as

echo $node->disqus_comments;

Thanks Rob!

marcingy’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)