Publisher does not support the Fluid field type. Please do not contact asking when support will be available.

If you purchased an add-on from expressionengine.com, be sure to visit boldminded.com/claim to add the license to your account here on boldminded.com.

Ticket: Category translation bug in search results for second language

Status Resolved
Add-on / Version Publisher 2.51
Severity
EE Version 3.5.10

Werner Gusset

Jun 29, 2017

On the search results page we have this code

{exp:search:search_results}

	{if channel_name == "produkte"}
		<p>
       <b><a href="{path='produkte/{publisher:reserved_category_word}/{categories}{exp:publisher:translate_category cat_id="{category_id}"}{cat_url_title}{/exp:publisher:translate_category}{/categories}'}">{title}</a></b><br>

      <span class="small">in {phrase:Produkte}</span><br>
      {excerpt}
    </p>
<p>  {/if}<br />
    ...<br />
{/exp:search:search_results}

For the default language (German) this works. It give an URL like this

http://www.vervesbox.ch/_meister/index.php/de/produkte/bereich/medical

In English (the second language) we get this URL

http://www.vervesbox.ch/_meister/index.php/en/products/section/"}{cat_url_title}{/exp:publisher:translate_category}'}

The part to translate the categories doesn’t get it right.

You can search for “dressing” on http://www.vervesbox.ch/_meister/index.php/en/. We display the URL of search results for testing.

 

#1

BoldMinded (Brian)

Try replacing {publisher:reserved_category_word} with your default language word for “category”.

#2

Werner Gusset

The results are exactly the same. The reserved category word is translating.

#3

BoldMinded (Brian)

I feel like you’re over thinking this. The {path} variable should parse url and category segments, so this should work:

{categories}
    {exp:publisher:translate_category cat_id="{category_id}"}
        {path='produkte/{publisher:reserved_category_word}/{cat_url_title}'}
    {/exp:publisher:translate_category}
{/categories}

or

{categories}
    {exp:publisher:translate_category cat_id="{category_id}"}
        {path='produkte/category-word/{cat_url_title}'}
    {/exp:publisher:translate_category}
{/categories}

I don’t think this is a bug in Publisher, it looks like you’re trying to do some funky template parsing, so its probably just a matter of trial and error to see what works. I’m confused on why you even need the {categories}{/categories} tag pair to begin with.

#4

BoldMinded (Brian)

Closing. Over a month old with no replies.

Login to reply