I was trying to use this with the Display Suite module, and it is not compatible. Has anyone figured out how to use them together?

Comments

dcomfort’s picture

It is compatible with Display Suite. It just takes a little work to do so

1) Under admin/settings/disqus, set Location to "Block"

2) Add a new block field at admin/build/ds/nd/fields

a) Enter field key
b) Enter Field Title
c) Under "Block" select Disqus Comments
d) Under BLock Render", select "render through block template"

3) Your new block should now appear in the display suite list of blocks (for instance, admin/build/ds/layout/blog) and then you can position it where you would like.

I hope this helps

zawaj’s picture

Issue tags: +zawaj

Merci pour votre précieuse aide.

robloach’s picture

Status: Active » Closed (fixed)

Yay!

BarisW’s picture

Thanks for sharing!

humanaut’s picture

Version: 6.x-1.6 » 7.x-1.9

I originally had this working on a site that I've been working on and off for the past 2 months.

The options are a bit different now compared to the above, but I chose the most appropriate options (or so I thought);

1) add a block field
2) node entity checked was "node"
3) block was disqus: comments
4) layout was default

I moved the block field into a display suite region in the Full Content display. The end result is a Disqus block that just has login options and a message that says "comments for this page are closed". Any node from that content type has the same message. I checked the Disqus config options, the content type has been selected. I also checked individual nodes and under the comments tab and the "Disqus comments" checkbox is selected.

I have uninstalled / reinstalled the module and recreated the block.

edit: I am not convinced that it is still a display suite problem. A bunch of nodes were imports and from 2-3 years ago. Those ones seem to be showing the comment box from disqus, but newer ones either created through this install of drupal, automatically say comments are closed still.. will have to keep investigating.
I am on Drupal 7.14.

krisahil’s picture

Excellent. @dcomfort, your suggestion works for me on Drupal 7.16 and Display Suite 1.2 and Disqus 1.9.

rajmataj’s picture

Here is what worked for me using:

  • Drupal 7.22
  • Disqus 7.x-1.9
  • Display Suite 7.x-2.2

Create a Display Suite block-field (admin/structure/ds/fields/manage_block), create your label and then set:

  1. Entities - node
  2. Block - Disqus: Comments
  3. Layout - Default

In the Disqus admin screen (admin/config/services/disqus), select your Node Type, and set the Location to: Block. It won't work for this scenario if you have the Location set to 'Content Area'.

You don't need this block assigned to a region in the normal Drupal blocks admin page, but instead, assuming you are using a Display Suite layout for the content type that you want to show the comments, place this custom field-block into whatever region suits you - typically the bottom of your content area.

maxmendez’s picture

Thanks for the help, very usefull

slashrsm’s picture

Category: bug » support
jay.lee.bio’s picture

For me it just eventually starting working, although maybe some specific steps I took (https://drupal.org/node/1159690, #46 & #47) somehow helped too.

GroovyMotion’s picture

Issue summary: View changes

What worked for me is to force the <? print render($content['disqus']); ?> inside the node.tpl to be in the links div...that made disqus appear below the content. :)
Only issue left is the teaser, it will show on the teaser only if it's default drupal comments but not with disqus.

I solved it!
In Views/Field you can add a disqus comment count! And it works in teaser! :)

*edit* it stopped working today!
If I have both Read more and disqus fields in display disqus disappears even if I put the readmore and disqus in separate regions

geeproud’s picture

Thanks for this information about this.

I have a working website with comments already (they use a different content type). I want to add Disqus to different content type (that uses Display Suite). I understand that I have to go into Disqus and choose "Block".

What is my risk here of screwing everything up? Do I basically have to switch it to Block and then go through all my content types and arrange the block to where i want it (even existing Disqus comments on existing content types)?

I am a novice with Drupal (just enough to be dangerous) so I want to make sure I have sufficiently planned this out before I do it.

Thanks!

jlyon’s picture

Status: Closed (fixed) » Needs review
StatusFileSize
new1.93 MB

This patch implements hook_ds_fields_info() to add Display Suite fields for Disqus comments and Disqus comment counts.

BarisW’s picture

Status: Needs review » Needs work

Wow, we don't need the Ckeditor library I guess? :)

BarisW’s picture

Version: 7.x-1.9 » 7.x-1.x-dev
Issue tags: -zawaj
jlyon’s picture

StatusFileSize
new1.75 KB

Heh, sorry about that...moving too fast I guess! Here's a better patch.

jlyon’s picture

Status: Needs work » Needs review
jlyon’s picture

StatusFileSize
new2.27 KB

This patch fixes two issues with the previous version:
1. Comment count field now uses a render array to add js assets. Using drupal_add_js wasn't always working.
2. Won't display comments or comment count when Disqus comments are turned off for the node.

robloach’s picture

This looks great, and I'm so glad to have more support for Disqus across a number of different systems.

+++ b/disqus.module
@@ -705,6 +705,83 @@ function _disqus_block_content($function, $options) {
+function disqus_ds_fields_info($entity_type) {

While I think it's great to add Display Suite support to Disqus, it might be good to split it into its own module, depending on both Display Suite and Disqus. This would encourage low coupling, and would keep a smaller Disqus module. Thoughts? It also means if you don't want/need Display Suite support for Disqus, then you'd simply make sure the disqus_ds (or whatever module name) is disabled.

+++ b/disqus.module
@@ -705,6 +705,83 @@ function _disqus_block_content($function, $options) {
+    drupal_add_js(drupal_get_path('module', 'disqus') . '/disqus.js');
+    drupal_add_js(array('disqusComments' => $entity->disqus['domain']), 'setting');

Might be able to use #attached here as well ;-) .

alemadlei’s picture

Hey guys,

I recently ran into this issue. However I fixed it a little different. On a custom module I implemented hook_field_extra_fields. This allowed me to set in UI the location of the disqus widget.


/**
 * Implements hook_field_extra_fields().
 */
function helper_field_extra_fields() {

  // Content types where we will add our extra fields.
  $types = array('specific_type1', 'specific_type2', 'specific_type3');
  
  // Base structure
  $extra = array(
    'node' => array(
    ),
  );

  // Adds disqus for each conte type.
  foreach ($types as $type) {
    $extra['node'][$type] = array(
      'display' => array(
        'disqus' => array(
          'label' => t('Disqus'),
          'description' => t('Disqus widget'),
          'weight' => 0,
        ),
      ),
    );
  }
  
  return $extra;
  
}

The patch mentioned should also work. but for those who can't patch it for some reason, this is an alternative.

Hope this helps someone.

kclarkson’s picture

the Patch in 18 works great!! I now have a Disqus Comments field in Display Suite and it is now visible.

Would be great to either commit or separate as a Disqus Sub-Module but it shouldn't be another contrib module.

slashrsm’s picture

Status: Needs review » Needs work

I agree with @RobLoach. Let's make this a sub-module of the main one.

osman’s picture

Status: Needs work » Needs review
StatusFileSize
new2.46 KB

I simply converted @jlyon's patch to create a sub-module to expose those disqus blocks as Display Suite fields. Thanks @jlyon.

kclarkson’s picture

Great job to @jlyon for the first patch. And Thanks to @osman for making it a sub module.

Patch
-Just Applied Patch Cleanly from the most recent dev git version
-Module page now shows Disqus DS
-Enabled Disqus DS module
-Went to Article Content Type manage Display and Boom!!! Disqus Comments and Disqus Comment Count
-Disqus Comments Field Works Gret

ERROR:
After Adding Disqus Comment Count I get the following error:

Notice: Undefined index: html in theme_link() (line 1646 of includes/theme.inc).

kclarkson’s picture

Status: Needs review » Needs work

  • RobLoach committed 43265c1 on 7.x-1.x
    Issue #863122 by jlyon, osman: Not Compatible with Display Suite
    
robloach’s picture

Status: Needs work » Fixed

Fixed up the bug @krisahil noted in #25 and pushed up to 7.x-1.x. Thanks a lot, guys! This looks great.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.