0

Version Disqus 7.x-1.12
Drupal 7.38
Disqus is only not showing on my panel page. On all the other pages, Disqus is shown. It has shown before on the same panel. I wish I knew all the things I did between the last time it appeared and when I noticed, but I don't.

Things I tried to no avail:

in the configuration settings (admin/config/services/disqus)

I tried adding the block into a region
* Visiblity- All node types selected; Location: Block
* Default options- All node types selected
* Behaviour- Localisation support: unchecked; Inherit User Credentials: checked
* Advanced- User Access Token: correct value; Public Key: correct value: Secret Key: correct value;
Visibility also set it to content area and weight tried 0, 50, 100, -100

Drupal Issue 1159690:

Doesn't correlate entirely to my issue because the HTML seems to be there (and not with me), but I suppose it was worth trying some ideas still.

Comment #9 insert <?php print render($content['disqus']); ?> into template

Comment #60 suggest to simply hit save again on said configuration page and somehow that would be all it took.

Drupal issue 928354

About panels integration. Patch at comment #17 no worky.

panel config:

Tried inserting the disQus block in every possible region of my Panel to no avail.

I also tried this (as mentioned in above issue )

# in /admin/settings/disqus underneath the Visibility section, choose the Block option in the Location dropdown menu.

Then you just select the "Disqus Comments" block from within the panels interface under the Miscellaneous tab.

On my panel page, when I do a dpm() of $node inside of the node.tpl.php file, there are 2 node objects in my Krumo. In each object there actually is an array for Diqus. This makes sense, because it is Disqus applied to the nodes inside of the panel. These comments don't show either though, but I don't want them to of course. I want 1 Disqus applied to my panel obviously instead.

Blocks configuration

I put the Disqus comments block in different regions of my theme, still same problem: showing up in other regions

Tried activating a different theme, same problem: Disqus shows on every page except the panel.

Updated the module to 7.x-1.12+5-dev, flushed cashes. Nothing changed.

  • How many nodes are in your panel? – oksana-c Jan 3 '16 at 23:05
  • @oksana Inside this panel there are those 2 nodes. In fact, there are 2 views in this panel, each outputting just 1 node. I.o.w., nodes inside of views inside of a panel. – Immers Jan 3 '16 at 23:44
  • Disqus is looking for context variables in panels. When you place disqus comment block in a panel that overrides node template, it finds node ID from url (node/%node) and uses that to render comments. When you create a custom panel page that contains two nodes as views - disqus block can't locate node ids to use for comment rendering. – oksana-c Jan 3 '16 at 23:51
  • Try inserting your nodes as existing node, not views, and see if disqus works. – oksana-c Jan 3 '16 at 23:55
  • I made a panel where inserted existing nodes straight away like you asked and just to see what happens then, but still no Disqus below it. I noticed you talked about when I want to place a Disqus block inside a panel. For the record, I did more things that just try to put a block inside the panel. (explained in my question) and frankly I don't care what exactly makes disqus show up below my panel, just as long as it does. Also, it is actually important that the panel has the views with one row; it has dropdowns as exposed filters and this functionality contains the actual value of the site – Immers Jan 4 '16 at 7:47
0

A workaround I found in this comment #5 out of the Disqus issuequeue adding disqus on the frontend.

    function HOOK_preprocess_page(&$vars) {
  if (module_exists('disqus')) {
    $identifier = $_GET['q'];
    if (strstr($identifier, 'path/to/add/comments/to')) {
      $domain = variable_get('disqus_domain', ''); // A.K.A. short name
      $url = url($_GET['q'], array('absolute' => true));
      $title = drupal_get_title();
      drupal_add_js(drupal_get_path('module', 'disqus') . '/disqus.js');
      drupal_add_js(array('disqus' => array('domain' => $domain, 'url' => $url, 'title' => $title, 'identifier' => $identifier)), 'setting'); // Add to the Drupal.settings for the script above to be able to pick it up.
      // Add the div to the page for the Disqus embed script to be able to drop in the comments code dynamically.
      $vars['page']['content']['system_main']['main']['#markup'] .= '<div id="disqus_thread"></div>';
    }
  }
}

Still curious about what it is in the backend that made the comment box disappear below the Panel though. I also disabled all the modules apart from the Disqus, panel en core, but still nothing.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.