Forum

Thread tagged as: Question

switching language in layouts.

Hi Drew, I've set up a multi lingual site, as per the how to in the documentation. I've got the nav and the title switching. What I'm unsure of is how to switch the content in layouts?

<?php if($lang == 'fr'){ ?>
 <footer>&copy; Droit d'auteur <?php echo date("Y"); ?> Tous les droits sont réservés.</footer>
<?php } else { ?>
 <footer> &copy; Copyright <?php echo date("Y"); ?> All rights reserved.</footer>
<?php } ?>  
Nick Loat

Nick Loat 0 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

You probably want to pass lang is as a layout variable:

https://docs.grabaperch.com/perch/pages-and-nav/layouts/variables/