Multilingual paragraph

Hi, I set my website to work with a different page depending on the website.
However, for some part, I need to echo all the languages (en, nl, fr). How could I do something like this :

	<?php echo $page->description()->kirbytext()->language('fr') ?>
	<?php echo $page->description()->kirbytext()->language('en') ?>
	<?php echo $page->description()->kirbytext()->language('nl') ?>

Thanks ! :slight_smile:

Should be :

<?php foreach($site->languages() as $language): ?>
    <?php echo $page->content($language->code())->description()->kirbytext(); ?>
<?php endforeach; ?>
1 Like

Thanks a lot ! :slight_smile:

Oh, another question,

do you know how to put a class for each language ?
Because now, they are all together… :slight_smile:

You have to wrap the echo with any tag you’d like, for example :

<?php foreach($site->languages() as $language): $code = $language->code(); ?>
    <div class="description-<?php echo $code ?>">
        <?php echo $page->content($code)->description()->kirbytext(); ?>
<?php endforeach; ?> 

Will echo the classes description-en, description-fr, etc.

Oh yeah, easy ! haha

thanks a lot !