Page 1 of 1

Mehrsprachige Kommentare im Galerie-Modul

Posted: Mon Aug 27, 2012 7:32 am
by dot
Ich möchte das Galerie-Modul so anpassen, dass das Kommentarfeld viersprachig ist. Nur leider bin ich völlig planlos, wie ich das am Besten angehe.

Die viersprachige Seite läuft mit MLE CMS. Das News-Modul habe ich bereits viersprachig gemacht, nach der supertollen Anleitung von Goran: http://blog.arvixe.com/creating-a-multi ... ms-module/

Re: Mehrsprachige Kommentare im Galerie-Modul

Posted: Mon Aug 27, 2012 8:40 am
by Jos
Goran hat es in seinen Anleitung bereits gesagt:
When a module doesn’t offer “Categories” you will have to make use of “Extra fields”. Basically what you would do is create a Module template using same technique as described above where we used $lang_parent variable to show correct News category.
Also du kannst im Gallery Modul drei extra Kommentarfelder hinzufügen (Feld anwenden auf: Galerien).

Dann ersetze:

Code: Select all

{if !empty($gallerycomment)}<div class="gallerycomment">{$gallerycomment}</div>{/if}
durch:

Code: Select all

{if $lang_parent == 'de' && !empty($gallerycomment)}<div class="gallerycomment">{$gallerycomment}</div>
{elseif $lang_parent == 'en' && !empty($fields.kommentar_en.value)}<div class="gallerycomment">{$fields.kommentar_en.value}</div>
{elseif $lang_parent == 'nl' && !empty($fields.kommentar_nl.value)}<div class="gallerycomment">{$fields.kommentar_nl.value}</div>
{/if}

Re: Mehrsprachige Kommentare im Galerie-Modul

Posted: Mon Aug 27, 2012 12:30 pm
by dot
Danke dir

Ich versuche das Ganze auf

Code: Select all

{if !empty($image->comment)} &bull; <em>{$image->comment|strip_tags|escape:'html'}<em>{/if}
anzuwenden und gelange zu

Code: Select all

{if $lang_parent == 'de' && !empty($image->comment)}&bull; <em>{$image->comment|strip_tags|escape:'html'}<em>
{elseif $lang_parent == 'fr' && !empty($fields.kommentar_fr.value)}&bull; <em>{$fields.kommentar_fr.value|strip_tags|escape:'html'}<em>
{elseif $lang_parent == 'en' && !empty($fields.kommentar_en.value)}&bull; <em>{$fields.kommentar_en.value|strip_tags|escape:'html'}<em>
{elseif $lang_parent == 'es' && !empty($fields.kommentar_es.value)}&bull; <em>{$fields.kommentar_es.value}
{/if}
was nicht funktioniert. Was mache ich falsch?

Re: Mehrsprachige Kommentare im Galerie-Modul

Posted: Mon Aug 27, 2012 2:34 pm
by Jos
Mein Beispiel war für Felder die für Galerien angewendet werden.

Versuch mal:

Code: Select all

{if $lang_parent == 'de' && !empty($image->comment)}&bull; <em>{$image->comment|strip_tags|escape:'html'}</em>
{elseif $lang_parent == 'fr' && !empty($image->fields.kommentar_fr.value)}&bull; <em>{$image->fields.kommentar_fr.value|strip_tags|escape:'html'}</em>
{elseif $lang_parent == 'en' && !empty($image->fields.kommentar_en.value)}&bull; <em>{$image->fields.kommentar_en.value|strip_tags|escape:'html'}</em>
{elseif $lang_parent == 'es' && !empty($image->fields.kommentar_es.value)}&bull; <em>{$image->fields.kommentar_es.value|strip_tags|escape:'html'}</em>
{/if}

Re: Mehrsprachige Kommentare im Galerie-Modul

Posted: Wed Aug 29, 2012 7:52 am
by dot
Perfekt! Das ist die Lösung. Geht, auch ohne <em></em>...

Ganz lieben Dank dir!