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.
Hello,
I notice the comment title for Pingbacks show as "Pingback". I have a recent comments block and I have a lot of links with the same title. Could the first few words of the comment be used as titles instead?
cheers,
G
Comments
Comment #1
giorgio79 CreditAttribution: giorgio79 commentedFor this I believe at line 300 we would need to change
to this
I am just adding this $title." ". to the subject which is saved as the title in comment table.
Comment #2
andreashaugstrup CreditAttribution: andreashaugstrup commentedSince the comment object can't have a custom status the only way to distinguish pingbacks from regular comments is by filtering on the title of the comment. That's why the title is left as "Pingback".
If you want a different title I suggest you change this in the theming layer.
Comment #3
giorgio79 CreditAttribution: giorgio79 commentedHi Andreas,
Thanks for coming back.
In fact you can distinguish pingbacks because they have their own input filter as per Greg's video tutorial.
Looking in the comments table, the input filter is a definite distinguisher.
Cheers,
G
Comment #4
kvarnelis CreditAttribution: kvarnelis commentedWhy can't there be an option for this? I'd love to have my Pingbacks say the title of the pinging post, or Pingback from: someblog.wordpress.com or something more than Pingback, which is going to be a mystery, I think, to the majority of my users.
Comment #5
jonathan1055 CreditAttribution: jonathan1055 commentedI wanted to do the same thing, and achieved it by making use of mytheme_preprocess_comment(). It could also be done using phptemplate_preprocess_comment(). Whichever you use, it should go in your themes template.php file. Here is an example which sets the title of the comment to 'Pingback from' followed by the name of the page it came from, which is also a link to that site. I think this is what you wanted:
I developed a slightly more complex version, which caters for all types of comments and says whether it is a comment, a reply or a pingback. Note that in my theme I have removed the title of the comment, and use two variables 'submitted' and 'submitted when', but the principle is the same.
[apologies for the indentation, can't seem to get it right because my text input box is not fixed-width font]
Hope that helps you to get going on this.
Jonathan
Comment #6
andreashaugstrup CreditAttribution: andreashaugstrup commentedGood point about using the format to distinguish. If someone makes a patch that makes an option out of the pingback title I will commit it. Should probably be able to choose between using "pingback", the first few characters of the pingback or a custom text as the comment title.