Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

new template page not showing on href link

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
kamalari86
Smarty n00b


Joined: 17 Mar 2015
Posts: 1

PostPosted: Tue Mar 17, 2015 12:58 pm    Post subject: new template page not showing on href link Reply with quote

I have a body.php file where I setup the pages
Code:

//body.php
<?php
   
    $pages = array(
           //general
       "home"          => "pages/general/home.php",
       "privacy"                => "pages/general/privacy.php",      
         
       "arhiva"            => "pages/general/arhiva.php",   
            "despre"                 => "pages/general/despre.php",
            "program"                => "pages/general/program.php",
            "parteneri"              => "pages/general/parteneri.php",
            "artisti"                => "pages/general/artisti.php",
             
       "harta"          => "pages/general/harta.php",      
            "galerii"               => "pages/galerii/galerii.php",
            "spatii"                => "pages/galerii/spatii.php",               
            "galerie"               => "pages/galerii/galerie.php",            
       "featuredartist"       => "pages/galerii/featuredartist.php",   
       "stiri"          => "pages/stiri/stiri.php",
       "stire"          => "pages/stiri/stire.php",      
            "nopage"                => "pages/general/nopage.php",
       );
         if ( !empty($_GET['page']) )  { $page = $_GET['page']; }
    else { $page = "home"; }
    $redirectPage = "pages/general/privacy.php";

   $smarty->assign('cur_page', $page);

    // get pages to be loaded
    $body = new Body();
    $bodyPages = $body->getPage($pages, $page, $redirectPage);
    $smarty->assign('body',$bodyPages);
?>

then I create the privacy.php page in the pages folder

Code:

//privacy.php
<?php
 
   
    $smarty = $_SESSION['smarty'];
   
   $lang = $_SESSION['lang'];
   $oras = $_SESSION['oras'];
   
   $heading['ro'] = 'Rights';
   $heading['en'] = 'Rights';
   
   
   
    // assign smarty variables
   $smarty->assign('heading', $heading);
   
   
   
   /* ======== page =========*/
   $root['ro'] = 'privacy-policy/';
   $root['en'] = 'privacy-policy/';
   
    $path['ro'] = "ro/".$oras."/".$root['ro'];
    $path['en'] = "ro/".$oras."/".$root['en'];
   $path['bu'] = $lang."/Bucuresti/".$root[$lang];
   $path['cl'] = $lang."/Cluj/".$root[$lang];

   
   $_SESSION['path'] = $path;
   $smarty->assign('path', $path);
   $smarty->assign('root', $root);   
   
   
   

   
 
       /* ======== SEO =========*/
    $smarty->assign('title','Noaptea alba a galeriilor - Privacy Policy');
    $smarty->assign('description','Noaptea alba a galeriilor');
    $smarty->assign('keywords','Noaptea alba a galeriilor');
    $smarty->display('general/privacy.tpl');
?>

I add the template to the templates folder, and when I add the link
Code:

{{if $lang=="ro"}}
       <li><a href="{{$lang}}/{{$oras}}/privacy-policy/" class="{{if $page=='privacy' or $page=='privacy'}}active{{/if}} privacy"> Privacy Policy</a></li>
    {{/if}}

the page not working its reset to the default page home, However when I change in the body.php at $page = 'privacy' the page is being created and shows that its exist in the debugger.

Can someone please help me , I'm new to smarty and this is my first project that I'm working on.

Thanks in advance
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP