Welcome Guest, Not a member yet? Register   Sign In
Modulated Templated CMS system
#17

[eluser]Avatar[/eluser]
this is where the configuration of modules and such begins. everything above this is environ lib.
this is how I have my file system structure setup for one template:
Code:
app/
      .htaccess //< Options -indexes RewriteEngine On Deny from all
            config/
                  environ.php
                  smarty_parser.php
            controllers/
                  default_controller.php
            helpers/
                  modules_helper.php
            languages/
                  english/
                        site_lang.php // autoloaded
                  russian/
                        site_lang.php
            libraries/
                  environ.php
                  modular_extensions.php
                  smarty_parser.php
            models/
                  template_model.php
            modules/
                  home/
                        controllers/
                              home.php
                        views/ // we won't use module views since all our views are smarty templates and will be inside app/views/smarty/templates
            views/
                  default_layout.php
                  smarty/
                        default_template/ //this is your default template which loads if no var is set in file or db
                        templates/
                              CLIENT_1/
                                    admin/
                                          tpl_account.php
                                          tpl_pages.php
                                          tpl_templates.php
                                    assets/
                                          .htaccess //< Options -indexes RewriteEngine On Allow from all
                                          css/
                                          images/
                                          js/
                                          pdf/
                                          swf/
                                    config/
                                          theme.php
                                    pages/
                                          tpl_about.php
                                          tpl_contact.php
                                          tpl_page.php
                                    tpl_admin.php
                                    tpl_head.php
                                    tpl_foot.php
                                    tpl_left.php
                                    tpl_content.php
                                    tpl_index.php //this loads your head foot left right and any other templates
                              CLIENT_2/
                                    /* RECURSION */
configure the main smarty template which loads all the rest of the templates from variables
this is what your tpl_index.php should looks like
Code:
&lt;!--{if !empty($head_tpl)}--&gt;
&lt;!--{include file="$head_tpl"}--&gt;
&lt;!--{/if}--&gt;        
            &lt;!--{if !empty($banner_tpl)}--&gt;
                &lt;!--{include file="$banner_tpl"}--&gt;
            &lt;!--{/if}--&gt;

            <div class="mainWrap">

                        &lt;!--{if !empty($left_tpl)}--&gt;
                        &lt;!--{include file="$left_tpl"}--&gt;
                        &lt;!--{/if}--&gt;                
                                
                        &lt;!--{if !empty($content_tpl)}--&gt;
                        &lt;!--{include file="$content_tpl"}--&gt;
                        &lt;!--{/if}--&gt;        
                                        
                        &lt;!--{if !empty($right_tpl)}--&gt;
                        &lt;!--{include file="$right_tpl"}--&gt;
                        &lt;!--{/if}--&gt;

            </div>

&lt;!--{if !empty($foot_tpl)}--&gt;
&lt;!--{include file="$foot_tpl"}--&gt;
&lt;!--{/if}--&gt;
tpl_content.php
Code:
<div class="centerWrap">
&lt;!--{$response}--&gt;
&lt;!--{foreach from=$template_pages key=template item=template_page}--&gt;
    &lt;!--{if !empty($template_page)}--&gt;
        &lt;!--{if $current_action eq $template}--&gt;
            &lt;!--{include file="$template_page"}--&gt;
        &lt;!--{/if}--&gt;
    &lt;!--{/if}--&gt;

&lt;!--{/foreach}--&gt;
    &lt;!--{if !empty($page_tpl)}--&gt;
        &lt;!--{if $current_action eq 'index'}--&gt;
            &lt;!--{include file="$page_tpl"}--&gt;
        &lt;!--{/if}--&gt;
    &lt;!--{/if}--&gt;
    </div>


Messages In This Thread
Modulated Templated CMS system - by El Forum - 03-05-2008, 12:02 PM
Modulated Templated CMS system - by El Forum - 03-05-2008, 12:08 PM
Modulated Templated CMS system - by El Forum - 03-05-2008, 12:15 PM
Modulated Templated CMS system - by El Forum - 03-05-2008, 12:18 PM
Modulated Templated CMS system - by El Forum - 03-05-2008, 01:03 PM
Modulated Templated CMS system - by El Forum - 03-06-2008, 11:46 PM
Modulated Templated CMS system - by El Forum - 03-07-2008, 01:41 AM
Modulated Templated CMS system - by El Forum - 03-07-2008, 03:59 AM
Modulated Templated CMS system - by El Forum - 03-16-2008, 10:07 AM
Modulated Templated CMS system - by El Forum - 03-16-2008, 05:51 PM
Modulated Templated CMS system - by El Forum - 03-16-2008, 07:05 PM
Modulated Templated CMS system - by El Forum - 03-16-2008, 08:02 PM
Modulated Templated CMS system - by El Forum - 03-17-2008, 03:36 AM
Modulated Templated CMS system - by El Forum - 03-17-2008, 03:38 AM
Modulated Templated CMS system - by El Forum - 03-17-2008, 03:39 AM
Modulated Templated CMS system - by El Forum - 03-17-2008, 03:52 AM
Modulated Templated CMS system - by El Forum - 03-17-2008, 04:26 AM
Modulated Templated CMS system - by El Forum - 03-17-2008, 04:29 AM
Modulated Templated CMS system - by El Forum - 03-17-2008, 04:35 AM
Modulated Templated CMS system - by El Forum - 03-17-2008, 04:41 AM
Modulated Templated CMS system - by El Forum - 03-17-2008, 04:46 AM
Modulated Templated CMS system - by El Forum - 03-17-2008, 04:53 AM
Modulated Templated CMS system - by El Forum - 03-17-2008, 10:38 AM
Modulated Templated CMS system - by El Forum - 03-17-2008, 10:45 AM
Modulated Templated CMS system - by El Forum - 03-17-2008, 10:52 AM
Modulated Templated CMS system - by El Forum - 03-17-2008, 07:01 PM
Modulated Templated CMS system - by El Forum - 05-11-2008, 12:06 PM
Modulated Templated CMS system - by El Forum - 06-12-2008, 08:41 PM
Modulated Templated CMS system - by El Forum - 07-24-2009, 03:32 PM



Theme © iAndrew 2016 - Forum software by © MyBB