Problem/Motivation

Currently, module can't alter the hard-coded title prefix, only theme can via THEME_facetapi_title

Proposed resolution

Allow module to alter facet title prefix via preprocess.

e.g

/**
 * Implements hook_preprocess_facetapi_title().
 */
function mymodule_preprocess_facetapi_title(&$variables) {
  // Remove title prefix
  $variables['title_prefix'] = '';
}
CommentFileSizeAuthor
#2 override-title-prefix-3144930-2.patch595 bytesxlin

Comments

xlin created an issue. See original summary.

xlin’s picture

Status: Active » Needs review
StatusFileSize
new595 bytes
xlin’s picture

Issue summary: View changes
joseph.olstad’s picture

Thanks for the patch

  • joseph.olstad committed 8847216 on 7.x-1.x authored by xlin
    Issue #3144930 by xlin: Allow module to alter facet title prefix via...
joseph.olstad’s picture

Status: Needs review » Fixed

looks good thanks

gonssal’s picture

This was a bad patch. The 'Filter by' string is no longer translatable.

  • joseph.olstad committed 1c53532 on 7.x-1.x
    Revert "Issue #3144930 by xlin: Allow module to alter facet title prefix...

  • joseph.olstad committed 8cb3988 on 7.x-1.x authored by xlin
    revert Issue #3144930 by xlin, joseph.olstad: Allow module to alter...
  • joseph.olstad committed 9de9797 on 7.x-1.x authored by xlin
    revert Issue #3144930 by xlin, joseph.olstad: Allow module to alter...
joseph.olstad’s picture

joseph.olstad’s picture

it's not that it was no longer translateable, but that the string changed (by a space) probably

so for that reason, I'll revert anyway, because yes this will unexpectedly cause someone to lose their translation and have to retranslate the string.

gonssal’s picture

It's not translatable, the 'Filter by' string has no t() around it. I will try to send a proper patch for this feature tomorrow if you still want it in.

joseph.olstad’s picture

sure if you can make another patch that'd be great, not sure if/when it will get in.

There's a bigger issue going on right now, looks like some upstream ctools change causes the automated tests to fail completely. not related to recent commits.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.