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.
The files views-view-fields--search-database-results.tpl
and views-view-fields--search-solr-results.tpl.php
contain <h3><?php print $title; ?></h3>
. However, panopoly_search already adds <h3>
tags round the title [1], resulting in invalid markup like <h3><h3 class="field-content"><a href="http://localhost">Test Content</a></h3></h3>
[1]: http://cgit.drupalcode.org/panopoly_search/tree/panopoly_search.views_de...
Comment | File | Size | Author |
---|---|---|---|
#5 | 2852563-oa_search-extratags-5.patch | 1.11 KB | Jorrit |
Comments
Comment #2
Argus CreditAttribution: Argus as a volunteer commentedGreat find, could you add a patch?
Comment #3
Jorrit CreditAttribution: Jorrit at nCode commentedSure. What kind of solution do you prefer? Just removing the
<h3>
from the template or adding a condition to check if the$title
var already contains a header tag?Comment #4
Argus CreditAttribution: Argus as a volunteer commentedThe last option looks more bulletproof, but both are fine imho.
Comment #5
Jorrit CreditAttribution: Jorrit at nCode commentedIn the end I chose the simple way because the code needed to properly determine if $title already contains a tag would be too much effort for a situation like, this in my opinion. Also, if the user doesn't want any header tag the template should respect that.
Comment #6
Argus CreditAttribution: Argus as a volunteer commentedComment #7
mpotter CreditAttribution: mpotter at Phase2 commentedThis makes sense. We want the View handler to specify the tag to use and not hardcode it into the template. Committed this to 75ae68b in oa_search.