This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
tutorials:design_adv:template_set_loading [2009/04/07 20:51] jonyo minor changes to wording |
tutorials:design_adv:template_set_loading [2014/09/25 16:55] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | {{indexmenu_n> | ||
====== Template Set Loading ====== | ====== Template Set Loading ====== | ||
- | Are you creating your own custom template design, but **don't want everyone to see the changes** until you are finished? | + | <tip c w>**Warning:** |
- | What the tutorial specifically does, is walk you through the steps to set it up so that it will " | + | Changes made using this tutorial can be undone using any of the pages in the admin panel under **Design > ** admin menu, so be sure to keep a "local" |
- | **Requires | + | Before attempting to make changes as described here, be sure you have a **firm grasp of [[tutorials/ |
+ | |||
+ | Remember, support for PHP customizations as described in this tutorial are outside the scope of the support we offer for Geo support. Geo Support can try to help you with the //how// and //where// for editing PHP files, but they cannot make changes for you or try to troubleshoot problems related to customized PHP files.</ | ||
+ | |||
+ | Are you creating your own custom template design, but **don' | ||
- | <tip c n> | + | What the tutorial |
- | These instructions can be used "in place of" or "in addition | + | <tip c n> |
This tutorial will walk you through the steps to set up your site, so that someone can view the site using specific custom template set just by viewing a special URL. | This tutorial will walk you through the steps to set up your site, so that someone can view the site using specific custom template set just by viewing a special URL. | ||
Line 18: | Line 23: | ||
**Instructions** | **Instructions** | ||
- | - Turn off Geo cache, if currently turned on, in your admin at **Site Setup > Cache**. < | + | - Turn off Geo cache, if currently turned on, in your admin at **Site Setup > Cache**.((Be sure to keep the cache turned OFF for as long as you are viewing the site with an alternate template set. Otherwise it will cache your alternate template set any time you view the site using it, so that " |
- | - In your admin, at **Templates | + | - In your admin, at **Design |
- For the purpose of this tutorial, we will assume your " | - For the purpose of this tutorial, we will assume your " | ||
- | - Download and open the file **geo_templates/ | + | - Download and open the file **geo_templates/ |
<code php> | <code php> | ||
<?php | <?php | ||
Line 30: | Line 35: | ||
## if you want. | ## if you want. | ||
## | ## | ||
- | ## Generated: | + | ## Generated: |
########################################### | ########################################### | ||
Line 42: | Line 47: | ||
* NOTE: Default template set is always added by system as the last template set | * NOTE: Default template set is always added by system as the last template set | ||
| | ||
+ | | ||
+ | * If you do not wish manual changes to be overwritten next time admin makes a | ||
+ | * change, be sure to put them in the " | ||
*/ | */ | ||
- | + | ||
+ | if (!defined(' | ||
+ | # [CUSTOM SECTION] # | ||
+ | //Anything manually added to this section will be left intact even if changes | ||
+ | //are made in the admin panel. | ||
+ | |||
+ | //BOO! | ||
+ | |||
+ | # [/CUSTOM SECTION] # | ||
+ | } | ||
geoTemplate:: | geoTemplate:: | ||
</ | </ | ||
- | If you are only using the default template set, that last line will be replaced by a //PHP Comment// stating that there are no template sets. That is normal. | + | If you are still only using the default template set, that last line will be replaced by a //PHP Comment// stating that there are no template sets. That is normal, however this setup is not common on " |
< | < | ||
- | - Add the following code after the "*/" | + | - Add the following code between |
<code php> | <code php> | ||
########## | ########## | ||
Line 58: | Line 76: | ||
//set a cookie to remember it, but make the cookie only last as long as the | //set a cookie to remember it, but make the cookie only last as long as the | ||
//browser session | //browser session | ||
- | set_cookie(' | + | setcookie(' |
//set cookie global so it works for this page load | //set cookie global so it works for this page load | ||
$_COOKIE[' | $_COOKIE[' | ||
Line 77: | Line 95: | ||
## if you want. | ## if you want. | ||
## | ## | ||
- | ## Generated: | + | ## Generated: |
########################################### | ########################################### | ||
Line 89: | Line 107: | ||
* NOTE: Default template set is always added by system as the last template set | * NOTE: Default template set is always added by system as the last template set | ||
| | ||
+ | | ||
+ | * If you do not wish manual changes to be overwritten next time admin makes a | ||
+ | * change, be sure to put them in the " | ||
*/ | */ | ||
+ | |||
+ | if (!defined(' | ||
+ | # [CUSTOM SECTION] # | ||
+ | //Anything manually added to this section will be left intact even if changes | ||
+ | //are made in the admin panel. | ||
########## | ########## | ||
Line 99: | Line 125: | ||
//set a cookie to remember it, but make the cookie only last as long as the | //set a cookie to remember it, but make the cookie only last as long as the | ||
//browser session | //browser session | ||
- | set_cookie(' | + | setcookie(' |
//set cookie global so it works for this page load | //set cookie global so it works for this page load | ||
$_COOKIE[' | $_COOKIE[' | ||
Line 108: | Line 134: | ||
} | } | ||
########## | ########## | ||
+ | |||
+ | # [/CUSTOM SECTION] # | ||
+ | } | ||
geoTemplate:: | geoTemplate:: | ||
Line 116: | Line 145: | ||
- To see your site using the // | - To see your site using the // | ||
- | < | + | < |
- This sets a cookie((Note that it sets, and uses, the cookie in the same block of custom code, the cookie is not otherwise used in the system besides what is done for the modifications to the t_sets.php file)) so that when you browse the site, until you close your browser, it will continue to use the " | - This sets a cookie((Note that it sets, and uses, the cookie in the same block of custom code, the cookie is not otherwise used in the system besides what is done for the modifications to the t_sets.php file)) so that when you browse the site, until you close your browser, it will continue to use the " | ||
Line 127: | Line 156: | ||
Below are a few tips: | Below are a few tips: | ||
* If you are afraid that someone you do not want to see the new design, might guess the **special URL**, and want to make it harder for them to figure out: You can change that code to be whatever you want in the **t_sets.php** file. You would then use a different URL based on what you changed the //code// to be. < | * If you are afraid that someone you do not want to see the new design, might guess the **special URL**, and want to make it harder for them to figure out: You can change that code to be whatever you want in the **t_sets.php** file. You would then use a different URL based on what you changed the //code// to be. < | ||
- | * You don't have to name the template set " | + | * You don't have to name the template set " |
+ | * Remember to keep your changes to be located **after** the line: <code php># [CUSTOM SECTION] #</ | ||
+ | * If you do not see the lines noted in the above note, and you are using at least version **5.1.1**, in your admin panel at **Design > Template Sets** make a change to what template sets are active and save changes, then change the settings back and save changes again. | ||
**Tips for PHP Developers: | **Tips for PHP Developers: | ||
Line 145: | Line 176: | ||
}</ | }</ | ||
< | < | ||
- | * When working with //user input// | + | * When working with //user input// |