The 11.11.14.23 and later versions of SEO Layered Navigation Plus and Search Engine Friendly (SEO) Layered Navigation, Paging, Sorting Links and Page Titles extensions allow rendering custom page title when one or several specified layered navigation filters are selected.
Example
The basic idea is the following: you add an m_page_titles.xml file to app/etc directory containing page title rendering rules. The page titles are altered once the file is added or modified. Here is the example of such a file:
<?xml version="1.0"?>
<!-- This file titles for pages with applied layered navigation filters. It also defines rules
of how to join titles of several simultaneously applied filter values. -->
<m_page_titles>
<case>
<if filter_code="manufacturer" value_label="AMD" />
<if filter_code="manufacturer" value_label="Apple" />
<set title="AMD and Apple Products at a Glance" />
</case>
<case break="1">
<if filter_code="manufacturer" value_label="AMD" />
<set title="Special Offers from AMD Electronics - {$site->title}" />
</case>
<case>
<if filter_code="manufacturer" value_label="Apple" as="value" />
<set title="iPhone and iPad with Love from {$value->title}" />
</case>
<values as="value">
<if filter_code="manufacturer" />
<apply pattern="'{$value->title}'" glued_by=" | " />
</values>
<values as="value">
<apply pattern="'{$value->title}'" glued_by=", " last_glued_by=" and " />
</values>
<filters as="filter">
<apply pattern="{$filter->title}: {$values}" glued_by="; " />
</filters>
<finally>
<set title="{$title}: {$filters}" />
<!--<set title="{$title}: {$values}" />-->
</finally>
</m_page_titles>
Example above consists of 2 parts:
- Several <case> rules apply specific page if certain filters are selected.
- <if> statements specify one or more filters for which specific page title is applied. Full syntax:
- filter_code (required) specifies attribute code or "category".
- value_label (required) specifies filter value.
- as="variable_name" (optional) introduces filter value as new variable.
- <set> statements alter page title variable $title or other variables. Each attribute name in this statement is variable name to be altered and value in quotes is value to be assigned.
- <if> statements specify one or more filters for which specific page title is applied. Full syntax:
- <finally and preceding auxiliary rules specify how filter values not picked by <case> rule should be reflected in page title. Typically little to no adjustment is needed in this part. Example above groups filter values by filter. If it is not needed, replace {$filters} to {$values} and remove <filters> rule.
{$site->title}, {$title} and similar are variables. Which are initially assigned and may be altered (or created using <set> statements.
How-To
Create Configuration File
To begin with customizing page titles, create new file in app/etc directory and name it m_page_titles.xml. Fill the file with the following:
<?xml version="1.0"?>
<m_page_titles>
</m_page_titles>
Then, check the result in store frontend. As you see, whatever layered navigation filters you apply, nothing happens - page title stays constant.
Change Title When Specific Filter Value Is Selected
After opening <m_page_titles> tag, add the following:
<case>
<if filter_code="enter attribute code here" value_label="enter value label here" />
<set title="Enter page title here" />
</case>
Then, check the result in store frontend. As you see, page title is completely replaced to the title you provided when specified filter value is applied.