Be sure to checkout our newest add-on, Speedy — Advanced Caching for ExpressionEngine.

Compatibility updates:

  • Publisher is EE5 compatible, but it does not currently support the Fluid field (it's in the works).

Ticket: Categories Archive Tag not working anymore after update to Publisher 3.0

Status Resolved
Add-on / Version Publisher 3.0
Severity
EE Version EE 5.3.0

Verve -Webdesign und Grafik

7 days ago

Hi
I updated from EE 2.11.9 to EE 5.3.0 and stayed on Publisher 2.11.2 first
After having this problem I updated to Publisher 3.0 but didn’t change the problem.

I think the setup of the categories is correct and before it worked well but now the translation of the categories doesn’t work.
Any idea?

#1

BoldMinded (Brian)

7 days ago

Hi there. “It doesn’t work” is not enough information for me to work off of, can you provide more information? You provided CP and FTP login, but didn’t tell me what URL to go to, or what template file I should look at? Logging into someone’s site also isn’t my first course of action. I only login into sites as a last resort. What template code isn’t working? Have you tried to simplify the issue? E.g. create only the very basic template code necessary to replicate the issue, then share that template code here in the ticket so I know what you’re referring to. Thanks.

#2

Verve -Webdesign und Grafik

7 days ago

Hi
Here is the code.
The tag

{exp:publisher:translate_category cat_id="{category_id}"}{cat_name}{/exp:publisher:translate_category}

ist not output in the second language (en)
I didn’t change the code that worked before.

<pre><code>
{exp:channel:category_archive channel=“kontakte” style=“linear” show_empty=“no”}
{categories}

  <h2 class=“mt-4”>{exp:publisher:translate_category cat_id=”{category_id}”}{cat_name}{/exp:publisher:translate_category}</h2>

  {exp:channel:entries
  channel=“kontakte”
  disable=“category_fields|member_data|pagination|trackbacks”
  dynamic=“no”
  category=”{category_id}”
  order_by=“title”
  sort=“asc”
  }

  <div class=“row”>
  <div class=“col-md-4”>
    <div class=“mb-4”>
    {if cf_kontakte_bild}
    {exp:ce_img:pair src=”{cf_kontakte_bild}”}
      {made}
    {/exp:ce_img:pair}
   

    {/if}
    </div>
  </div>
  <div class=“col-md-8”>
    <div class=“mb-4”>
    {title}

    {if cf_kontakte_funktion}
    {cf_kontakte_funktion}
   

    {/if}

    {if cf_kontakte_telefon}
   

    <i class=“fa fa-phone” aria-hidden=“true”></i> {cf_kontakte_telefon}
    {/if}
    {if cf_kontakte_mail}
   

    <i class=“fa fa-envelope-o” aria-hidden=“true”></i>
    {/if}
    </div>
  </div>
  </div>     
  {/exp:channel:entries}
{/categories}
{/exp:channel:category_archive}
<pre><code>

#3

Verve -Webdesign und Grafik

7 days ago

Comment has been marked private.

#4

BoldMinded (Brian)

7 days ago

Create a debug template that contains only the bare minimum code, e.g.

{exp:channel:category_archive channel=“kontakte” style=“linear” show_empty=“no”}
    {categories}
        {exp:publisher:translate_category cat_id=”{category_id}”}{cat_name}{/exp:publisher:translate_category}
    {/categories}
{/exp:channel:category_archive}

It’s been awhile since this has come up, but you shouldn’t need to call translate_category inside a category_archive tag. Publisher should translate them for you, e.g.

{exp:channel:category_archive channel=“kontakte” style=“linear” show_empty=“no”}
    {categories}
        {cat_name} <!-- or whatever the correct EE variable name should be -->
    {/categories}
{/exp:channel:category_archive}
#5

Verve -Webdesign und Grafik

6 days ago

With your example all the category-names will be shown, but not in a translated version (still de instead of en)

#6

BoldMinded (Brian)

6 days ago

Ok, I will try to replicate this locally. In your original report you said you were on version 2.11.2, and it didn’t work in that version either, correct? Or it only stopped working after upgrading to 3.0?

#7

BoldMinded (Brian)

6 days ago

Try adding a var_prefix. Should fix it. The {cat_name} field is colliding with EE’s native value.

{exp:channel:category_archive channel="pages" style="linear" show_empty="no"}
    {categories}
        {exp:publisher:translate_category cat_id="{category_id}" var_prefix="cat:"}{cat:cat_name}{/exp:publisher:translate_category},
    {/categories}
{/exp:channel:category_archive}
#8

Verve -Webdesign und Grafik

6 days ago

It stopped working after update to EE 5.3.0 and beeing on Publisher version 2.11.2

Well, the var_prefix does it in the testcode/your example but not on my template with the code I posted in #2
Why this?

#9

BoldMinded (Brian)

6 days ago

I don’t know why it wouldn’t work in your full example, but it works in the simplest usage, so I would remove other parts of your template until it starts working again to determine what the conflict might be. I wrote a helpful article about debugging, might be worth the read. https://u.expressionengine.com/article/debugging-in-expressionengine

#10

Verve -Webdesign und Grafik

6 days ago

Had a mistake in the code - now works perfect. Thanks a lot!

Login to reply

Contact

For add-on support, please use the Support section. General inquries and pre-sale questions can be sent to support@boldminded.com.