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.
When the similar entries module is installed, it creates links to pages with similar content. The link is missing the title tag making the code html strict invalid.
Example:
<a href="http://localhost/test-page-2">test page 2</a>
The link should be constructed as follows:
<a href="http://localhost/test-page-2"
title="Test page 2">test page 2</a>
Current code in the theme_similar_content() function in similar.module:
array(
'attributes' => variable_get('similar_rel_nofollow', 0) ? array('rel' => 'nofollow') : NULL,
'absolute' => TRUE
)
I am not using nofollows, so I modified it like this:
array(
'attributes' => array('title' => ($content->title)),
'absolute' => TRUE
)
Comments
Comment #1
xjessie007 CreditAttribution: xjessie007 commentedHere is an update to make it work with the nofollow too.
Current code:
Updated code:
This will make the similar.module work to reflect both nofollow settings as well as to display title in the link HTML code.
(Sorry, I do not know how to make a patch, and I am not a programmer either, so I am just posting the suggested change in the code here as a FYI.)
----
Maxi-Pedia
Comment #2
jordojuice CreditAttribution: jordojuice commentedThat is fine. Thanks for the work. This will be committed probably tonight. Sorry that it took so long to respond. I just took over development of the module as the previous maintainer was tied up in other work. I'm working to clear out the queue and get bug fixes in, though.
Comment #3
jordojuice CreditAttribution: jordojuice commentedThis has been committed to dev and will go in the next release. Thanks for the work! : )