1

I've rewritten the node pages on my website with a Panel page (using node_edit) and added the node's comments as a Pane. When no comments have been published yet, the Pane is hidden. However, I'd like to still display the Pane's title and a sentence underneath that says something like: Be the first to react.

I already have a template panels-pane--node-comments.tpl.php and added some lines under if(!$content}{print t('Be the first to react.');}, but as the Pane isn't displayed, the template isn't activated. What should I do?

I know that I could create a View that shows all the node's comments and set a value when there aren't any, but maybe that's overkill?

  • Rather than figuring out this pane business, I would approach this specific comment secenario as, if comment count equals 0, print be the first to react. – No Sssweat Mar 12 '16 at 3:21
4
+50

Create a new pane with that text and set a visibility rule on it - there should be an existing rule that you can use. If not a ctools rule plugin is pretty simple to write and you can have that rule plugin check to see if comment count is 0.

0

Add another pane (text area holds the string) to be displayed if the comment count equals 0.

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.