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: Filter category url

Status Resolved
Add-on / Version Publisher
Severity Critical
EE Version 24

Esther

May 15, 2013

Hi,

I’m using publisher with structure and freebie in my website. I’m new on using publisher. I have a problem with the categories. The translation of the categories is working, but when i want to filter on the categorie in the url.  On the default language it’s working just fine, but when i switch the language to “EN” it’s not working. The problem is that i don’t get a category id for my segment. I know i do something wrong, but can’t figure out what i do wrong. 
I use freebie to ignor al segments after ‘nieuws’ and ‘news’. On the default language site is ‘{exp:freebie:category_id segment='2'}’ a number but on the other language it’s empty. Is there a solution for this?

The link to the website is:
http://dev.bosmanwater.de/nl/nieuws/cat-zuiveringsinstallaties (this one works fine)
http://dev.bosmanwater.de/en/news/cat-purification-plants (this one does not work)
My template code is:

{exp:freebie:category_id segment="2"} 
{exp:channel:entries channel="nieuws" category="{exp:freebie:category_id segment='2'}" dynamic="no" parse="inward"}
    
     {if count == 1 OR count == 2}
      <article class="article">
       <header class="article-header">
        <h3 class="section-heading nieuws-title">{title}</h3>
<p>        <span class="article-meta">Geplaatst op {entry_date format="%d %F %Y"} in <br />
         <a href="#">{categories} {category_name} {/categories}</a><br />
        </span>      <br />
       </header><br />
       {exp:channel_images:images entry_id="{entry_id}" limit="1"}<br />
        </p><figure class="side-article-photo pull-right">
         <img src="{image:url:medium}" width="{image:width:medium}" height="{image:height:medium}" alt="{image:title}"> 
        </figure>
<p>       {/exp:channel_images:images}<br />
      </p><div class="article-content pull-left">
<p>        </p><p>{nieuws_intro}</p>
<p>        <a href="{site_url}/nieuws/{categories}{category_url_title}/{/categories}{url_title}" class="article-button-more">{phrase:lees_verder}</a>    <br />
      </p>
</div><p>{!-- end .article-content --}<br />
      </p>
</article><p>{!-- end .article --}<br />
     {if:elseif count == 3}<br />
      </p><section class="dates-list">
<p>      </p><h5>{phrase:meer_nieuws}</h5>
<p>      </p><ul>
        <li>
         <span class="dates-list-date">{entry_date format="%d-%m-%Y"}</span>
         <span class="dates-list-ref">
          <a href="{site_url}nieuws/{categories}{category_url_title}{/categories}/{url_title}">{title}</a>
         </span>
        </li>
     {if:elseif count == total_results}
        <li>
         <span class="dates-list-date">{entry_date format="%d-%m-%Y"}</span>
         <span class="dates-list-ref">
          <a href="{site_url}nieuws/{categories}{category_url_title}{/categories}/{url_title}">{title}</a>
         </span>
        </li>
       </ul>
<p>      </p>
</section><p>{!-- end .dates-list --}<br />
     {if:else}<br />
        </p><li>
<p>         <span class="dates-list-date">{entry_date format="%d-%m-%Y"}</span><br />
         <span class="dates-list-ref"><br />
          <a href="{site_url}nieuws/{categories}{category_url_title}{/categories}/{url_title}">{title}</a><br />
         </span><br />
        </p>
</li>

<p>     {/if}<br />
    {/exp:channel:entries}

 

#1

BoldMinded (Brian)

I’m not sure freebie will work with translated URLs. Have you tried using the {publisher:segment_X} variables instead?

#2

Esther

Yes, i have tried that, but i don’t get a id back.

#3

BoldMinded (Brian)

Sorry, I responded too quickly last time and realize what you’re looking for. I think I can get it to create {publisher:segment_X_category_id} variables fairly easily. I’ll try to have a new build to you by Monday.

#4

BoldMinded (Brian)

Esther, instead of adding this to Publisher, I added it to URL Helper instead, which part of it mimics Low Seg 2 Cat. Try it out: https://github.com/litzinger/URL-Helper. The {segment_X_category_id} variable should give you the cat_id even if its a translated category.

#5

BoldMinded (Brian)

I’m going to mark this resolved b/c the URL Helper extension should provide what you’re looking for now.

Login to reply