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.
Hi, I have a couple thousand content nodes, of which less than half have a teaser or a manually filled out metatag description. You currently have the very useful option: "Use the node teaser if the description meta tag is not set", which I set per content type. Could you please consider adding a second option "Use first 200 plain text characters of body if meta tag and teaser are not set".
If you would be willing to add this feature, I will happily send you $100 via PayPal. Thanks in advance, and thanks for a great module.
Comment | File | Size | Author |
---|---|---|---|
#3 | nodewords_0961B013.patch | 28.77 KB | apaderno |
Comments
Comment #1
apadernoAs there is already an option to populate the meta tag from the node teaser, it makes sense to add an option to populate it from the node body. I would also add an option that allow to decide the length of the body text to use.
Here, it is holiday for two days (Christmas, and Saint Stephen). I will start to work on this on December 27.
Comment #2
k74 CreditAttribution: k74 commentedIn versions 1.8 and 1.9 do not appear in the source code for custom node types keywords and description tags which I put on each node, when you edit are there, but when you see the notice in the source code are not. In story and pages are displayed correctly, but in the types of content I've created custom labels are not keywords and description.
In version 1.5 and earlier appeared correctly, that happened?
Configured Options:
- "Global keywords" is empty
- "Default values" and "Tracker pages" description and keywords are empty
- "Use the node teaser if the description meta tag is not set" is enabled
Comment #3
apaderno@k74: What you are reporting is not related with this feature request; please open a different report.
The attached file is the patch with the changes I made to implement the feature (the patch is made against the development snapshot).
Comment #4
apadernoThe code has been changed, and committed to CVS.
Comment #5
dankohn CreditAttribution: dankohn commentedI tested this 6.x-1.x-dev and it works exactly as I requested. Thanks!
Comment #6
apadernoYou are welcome.
I forgot to say that both the node teaser, and the node body are truncated to the maximum size set for the meta tags in the settings page. The code doesn't use the node teaser, or the node body if the input format uses the PHP filter, and the text actually contains <?php; in that case, the returned value is an empty string.
I should maybe add a note in the setting page.
Comment #7
apadernoThe code needs to be changed also in the branch 6.x-3.
Comment #8
dankohn CreditAttribution: dankohn commentedI believe there may be a bug in this code. On this page, I have a teaser and body but no metatag description set. However, the header says:
I'm happy to give you an admin account on my staging server to evaluate the issue. Thanks.
Comment #9
apadernoIt has been reported in #669896: Meta tags content is not correctly shown, which is now fixed in the development snapshot. I will create a new official release in the next 24 hours.
Comment #10
dankohn CreditAttribution: dankohn commentedThanks for the quick reply. I'll look forward to the next release.
Comment #11
apadernoI am marking this report as fixed as the code has been already implemented, and fixed.
The code will be also ported to branch 6.x-3.