diff --git a/README.md b/README.md index bce852a..e58b28c 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Easily switch between sites on any page of your website. This plugin provides an easy way to switch between sites on your website. Regardless of which page you are currently on, you will be linked to the same page in its parallel site. -_* Note: You must be using Craft's [multi-site](https://craftcms.com/features/multi-site) feature to access multiple languages on your website._ +_* Note: You must be using Craft's [multi-site](https://craftcms.com/features/all#multi-site) feature to access multiple languages on your website._ *** @@ -79,6 +79,8 @@ A simple piece of code like this one will work great across 99% of sites: You can use this code in an `include`, and share it across your entire website. If the page is an `entry` page, it will use the localized version of that entry's slug. Otherwise, it will simply retain the same URI for each link. +### Dynamically looping through all sites + If you want to dynamically loop through each of your sites, try this instead: ```twig @@ -91,6 +93,23 @@ If you want to dynamically loop through each of your sites, try this instead: ``` +### Checking whether a translated element exists + +Lastly, you can check to make sure that a translated version of that element exists before showing the link: + +```twig +{% set element = (category ?? entry ?? null) %} + +