I'm trying to find out the best way to use multi language pages with HubDB and dynamic pages. Since I cannot set the Meta Title and Meta Description per language or through Hubl code, I'm wondering what solution would be best to solve this.
Situation:
I'm setting up a HubDB for some pages that I'd like to create. These pages are available in two languages (English and Dutch). Each row holds content for both languages.
I can only set one Meta Title field, but I would need two. Same goes for Meta Description.
I could 'solve this' in a couple of ways, but I'd like your advice on this.
Solution 1:
Use a language column in the HubDB and enter each 'page' twice, one in English and one in Dutch. Use the template to only load the items in the language that is used.
Pro: easy fix Con: extra rows
Solution 2:
Use a separate HubDB per language and use a template for English and a separate template for Dutch.
Pro: also quite easy fix
Con: extra HubDB and extra Template
I searched the forum and help articles on this, but none of the info I found is about multi language dynamic pages.
I would really appreciate any help or some indication to understand which one of my 'solutions' would be smartest.
I went for Solution 2. Seemed the easiest to implement and maintain for my marketing colleagues. Also this allows for duplicate url paths. Putting in all in 1 HubDB would not allow me to use the same path twice. Since I'm running 2 languages, I would like some of the paths to be the same (except for the language parameter ofcourse).
To risolve this problem i create a translate page of template just for have a page in 2 language.now i can access to the master page and using language dropdown menu for change the content setting.but my problem is the page path url is unique .how can Ido?
Sorry for the late reply, but here's some insight on how I got this to work with just 1 template and 2 HubDB tables.
So, I have 2 HubDB tables:
Feeds EN
Feeds NL
They both have the same table structure.
Then, I have one template, where I include a custom module. In that specific custom module, I check the language of the page by checking the 'content.language.languageTag' value. Based on the value, I select the right HubDB table.
{% if content.language.languageTag == 'nl' || taaltje == 'nl' %} {% set table = hubdb_table_rows(xxxxx1,'orderBy=Name&draft=No') %} {% else %} {% set table = hubdb_table_rows(xxxxx2,'orderBy=Name&draft=No') %} {% endif %}
This way, I can just use a single template for every language of the page and use a HubDB per page.
Then, in the template in the section that holds the markup for the detail page of the item in the HubDB, I include some wrapping HTML around the section to set the right HubDB table ID for the content page, so that my code gets its data from the right HubDB table:
{% if content.language.languageTag == 'nl' || taaltje == 'nl' %} {% set dynamic_page_hubdb_table_id = xxxxx1%} {% else %} {% set dynamic_page_hubdb_table_id = xxxxx2%} {% endif %}
{% if dynamic_page_hubdb_row %} {{ html }} {% endif %}
Pretty technical solution, but this works perfectly for us and requires no extra work for our marketeers.
{% set dynamic_page_hubdb_table_id = xxxx%} {% set number = ['1','4','7','10','13','16'] %} {% set queryparam = table|selectattr('categoryid','equalto','Gade') %}
I went for Solution 2. Seemed the easiest to implement and maintain for my marketing colleagues. Also this allows for duplicate url paths. Putting in all in 1 HubDB would not allow me to use the same path twice. Since I'm running 2 languages, I would like some of the paths to be the same (except for the language parameter ofcourse).
i would like to know the answer of this subject please because i am creating a dynamic multilingual page ,i have the problem of this regard on the url page details translate.
this is my page and DB
how can you see the page detail
but when i translate the page at the level route url is translate correctly
but the translate details page url is not translate because the page path is unique
how can i do ?create a HubDB for each language ? what is the best solution?