Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I need the default value for enabling/disabling Disqus on the content type.
The attached patch:
* adds a default value to the content type (in the comment vertical tab).
* content type's default value is used when creating the node edit form (instead of the current hardcoded value, TRUE).
PS: I have also cleaned up a little, replacing the hook_form_alter implementation with two hook_form_FORM_ID_alter implementations.
Comment | File | Size | Author |
---|---|---|---|
#2 | disqus-content-type-default-2.patch | 6.11 KB | randallknutson |
disqus-content-type-default.patch | 6.5 KB | _wdm_ | |
Comments
Comment #1
slashrsm CreditAttribution: slashrsm commentedThis JS file should be included in the patch.
Why not use disqus_nodetypes to save this?
Comment #2
randallknutson CreditAttribution: randallknutson commentedNot being the original author I'm not sure what the javascript file did but it isn't necessary. I've removed it from my patch.
The reason that disqus_nodetypes is not used is that this isn't about allowing or not allowing disqus comments on a content type as that config variable does. It is for setting the default status of disqus on content types where comments ARE allowed.
For example, we need to allow comments on the blog content type but default them to off. Unless someone with permission turns them on then they should be off.
Patch attached with the following changes:
Comment #3
randallknutson CreditAttribution: randallknutson commentedComment #4
slashrsm CreditAttribution: slashrsm commentedAttached JS file was probably updating summary in vertical tab. It would be nice to have that feature. Otherwise looks good.