I am using a current search block and would therefore like to limit the page title to the default page title (without all the search terms showing in a guided search).

What is the best way to change the title?

See attachment with an extended title example from your demo site.

Comments

david lesieur’s picture

Title: Best Way to Limit Title (drop current search elements) » Allow overriding of page title
Version: 5.x-1.0-beta4 » 6.x-1.x-dev
Component: General » Code
Category: support » feature

There are no easy ways to override the title at the moment. You could edit one of Faceted Search's files as in #326797: remove title text from breadcrumb and results page.

Turning this into a feature request. Perhaps the page title should be set from within a theme function.

seanburlington’s picture

Status: Active » Needs review
StatusFileSize
new1.94 KB

Hi,
I need to theme the title for my site - thanks for the issue report which saved me from thinking there was already a way to do this.

The attached patch solves the problem for me - it'd be great to have it incorporated into the project.

I've just turned faceted_search_ui_set_title into theme_faceted_search_ui_title - then I set the title according to the themed results.

This should give identical functionality for existing users, with a theme function available for override.

seanburlington’s picture

The previous patch missed one used on the function I've made themed

--- faceted_search_ui.module    (.../trunk/public_html/sites/all/modules/faceted_search/faceted_search_ui.module)       (revision 700)
+++ faceted_search_ui.module    (.../branches/release-8/public_html/sites/all/modules/faceted_search/faceted_search_ui.module)  (revision 773)
@@ -423,7 +423,7 @@ function faceted_search_ui_stage_select(
   // Build the search results, which are required to count nodes per category
   $env->execute();

-  faceted_search_ui_set_title($env);
+  theme('faceted_search_ui_title', $env);

   $keyword_block_content = faceted_search_ui_keyword_block($env);
   $guided_block_content = faceted_search_ui_guided_block($env);

arski’s picture

hmm, in your last post, you should be replacing the old function by
drupal_set_title(theme('faceted_search_ui_title', $env));
not by
theme('faceted_search_ui_title', $env);
which does nothing :)

And also I would rather have the title setting inside the theme function. The common situation is that a person wants to have the same title on the search results page as the main page of some listing.. now with this I would still have to retrieve the actual title of a page to set it again.. which makes no sense..

otherwise working good, cheers

arski’s picture

OK, I take the second part of that comment back, seeing that the result pages are not in any menu etc., they have no default title, so this is surely needed. Maybe it would be a good idea to have the title of the start_page in the $env or something.. otherwise +1 for the patch.

seanburlington’s picture

Status: Needs review » Needs work

Hi arski,
I'm afraid I'm no longer using faceted search so I won't be able to update the above patch information.

I didn't manage to get my second comment rolled into a patch anyway so I'm marking this as needs work - hopefully what has been written so far is a good starting point for someone else who needs this functionality.

YK85’s picture

subscribing