CMS Development

Dallas_Antwerp
Contributor

Get translated content slug - {{ content.translated_content.en.slug }}

Hi,

I need to get the translated url of a webpage. The alternate url hubspot puts inside the head-tag:Schermafbeelding 2017-05-08 om 20.12.40.png

 

 

 

I tried to get it by the json format of the 'developer info' tab, but nothing renders:

Schermafbeelding 2017-05-08 om 20.17.29.png

used code -> {{ content.translated_content.en.slug }}

 

I've done some debugging, by using different json formats, but the only thing i can get to render on page is:

 

Schermafbeelding 2017-05-08 om 20.20.52.png

 

 

used code -> {{ content.translated_content }} 

 

 

 

Where i'm i going wrong?

0 Upvotes
4 Replies 4
aureliocampos
Member

Get translated content slug - {{ content.translated_content.en.slug }}

Isso vai retornar o resultado esperado: 

 

{% if content.translated_content %}
  {% for item in content.translated_content %}
   {{item.slug }}
  {% endfor %}
{% endif %}

 

Então, você pode salvar o "item.slug" em uma variável para usar posteriormente.

 

benvanlooy
Top Contributor | Platinum Partner
Top Contributor | Platinum Partner

Get translated content slug - {{ content.translated_content.en.slug }}

Has anyone got an update of this issue?

 

I've run into exact the same problem and can't seem to find a proper solution..

 

I could start using javascript to get what I need, but I would like to use the proper hubspot way, that should actually work..

 

 

0 Upvotes
ChadP
Contributor | Elite Partner
Contributor | Elite Partner

Get translated content slug - {{ content.translated_content.en.slug }}

Try adding  a.slug to the hubl call like so:

 

{{ content.translated_content.slug }}
0 Upvotes
ChadP
Contributor | Elite Partner
Contributor | Elite Partner

Get translated content slug - {{ content.translated_content.en.slug }}

Or You Can Try:

 

{{ translated_content.en.slug }}
0 Upvotes