Mehrsprachige Kommentare im Galerie-Modul

Hilfe zu Modulen und Tags
Post Reply
dot
Forum Members
Forum Members
Posts: 21
Joined: Tue Nov 16, 2010 1:26 pm

Mehrsprachige Kommentare im Galerie-Modul

Post 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/
Jos
Support Guru
Support Guru
Posts: 4017
Joined: Wed Sep 05, 2007 8:03 pm
Location: The Netherlands

Re: Mehrsprachige Kommentare im Galerie-Modul

Post 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}
dot
Forum Members
Forum Members
Posts: 21
Joined: Tue Nov 16, 2010 1:26 pm

Re: Mehrsprachige Kommentare im Galerie-Modul

Post 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?
Jos
Support Guru
Support Guru
Posts: 4017
Joined: Wed Sep 05, 2007 8:03 pm
Location: The Netherlands

Re: Mehrsprachige Kommentare im Galerie-Modul

Post 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}
dot
Forum Members
Forum Members
Posts: 21
Joined: Tue Nov 16, 2010 1:26 pm

Re: Mehrsprachige Kommentare im Galerie-Modul

Post by dot »

Perfekt! Das ist die Lösung. Geht, auch ohne <em></em>...

Ganz lieben Dank dir!
Post Reply

Return to “Module und Tags”