Created
October 22, 2010 08:27
-
-
Save erikreagan/640168 to your computer and use it in GitHub Desktop.
EE template to serve as "base" templates which see if a country-specific version is available (multi-lingual site). If not then the "default" version is loaded.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{!-- | |
/** | |
* This is a template loader for our multi-lingual / multi-regional site | |
* It takes pieces of parameters and assembles them into template_group/template format | |
* Then checks the DB to see if such a template exists. If it does then it returns the TRUE stuff | |
* If the template does NOT exist it returns the FALSE stuff | |
* It can be run as a single template tag to return "y" or "n" on if it exists OR | |
* it can be run as a tag pair to return other data based on the result | |
* | |
* A small custom plugin was written for this functionality | |
* pi.if_template.php | |
*/ | |
--} | |
{exp:if_template:exists | |
template_prefix="{country_seg}_" | |
template_name="index" | |
template_group="site" | |
default_prefix="d_" | |
require_prefix="y" | |
} | |
{embed="{template_path}"} | |
{if_template:else} | |
{embed="{default_path}"} | |
{/exp:if_template:exists} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment