Page 1 of 1

How to add php code to side bar - please help

Posted: Tue Jul 14, 2009 3:16 pm
by rony2006
Hello everyone, i want to add a php script in side bar like in image
Image

My template is




{* Change lang="en" to the language of your site *}



{sitename} - {title}
{* The sitename is changed in Site Admin/Global settings. {title} is the name of each page *}

{metadata}
{* Don't remove this! Metadata is entered in Site Admin/Global settings. *}

{stylesheet}
{* This is how all the stylesheets attached to this template are linked to *}

{cms_selflink dir="start" rellink=1}
{cms_selflink dir="prev" rellink=1}
{cms_selflink dir="next" rellink=1}
{* Relational links for interconnections between pages, good for accessibility and Search Engine Optmization *}


{literal}

=b){nw=b+"px";}if(w



#pagewrapper {width:expression(P7_MinMaxW(720,950));}
#container {height: 1%;}


{/literal}
{* The min and max page width for Internet Explorer is set here. For other browsers it's in the stylesheet "Layout: Left sidebar + 1 column" *}





{* The above JavaScript is required for CSSMenu to work in IE *}







    {* start accessibility skip links *}
   
      {anchor anchor='menu_vert' title='Skip to navigation' accesskey='n' text='Skip to navigation'}
      {anchor anchor='main' title='Skip to content' accesskey='s' text='Skip to content'}
   
    {* end accessibility skip links *}


   
    {* Horizontal ruler that is hidden for visual browsers by CSS *}


   {* Start Header, with logo image that links to the default start page. Logo image is changed in the stylesheet  "For template: Left menu + 1 column" *}
   
           {cms_selflink dir="start" text="$sitename"}
   
   
   {* End Header *}


   {* Start Search *}
   
          {search}
   
   {* End Search *}


   {* Start Breadcrumbs *}
   
        {breadcrumbs starttext='You are here' root='Home' delimiter='»'}
   
   
   {* End Breadcrumbs *}


   {* Start Content (Navigation and Content columns) *}
   

')
}

  random_imglink()
//-->


      {* Start Navigation *}
     
         Navigation
         {menu template='cssmenu.tpl'}
     
     

 
      {* End Navigation *}


      {* Start Content Area *}
     
         {print showbutton=true script=true}
         {* {title} *}
         {content}


         {* Start relational links *}


{anchor anchor='main' text='^ Top'}

         
            {cms_selflink dir="previous" label="Previous page: "}

            {cms_selflink dir="next"}
         
         {* The label parameter doesn't need to be there if you're using English, but is here to show how it's used if you don't want the English text "Previous page" *}
{* End relational links *}

     
     
  {* End Content Area *}

   
   {* End Content *}


   {* Start Footer. Edit the footer in the Global Content Block called "footer" *}
   
      {global_content name='footer'}
   {* End Footer  *}


{* end pagewrapper *}

Please help and sorry for my english

Re: How to add php code to side bar - please help

Posted: Wed Jul 15, 2009 7:09 am
by reneh
its not php  its java!
See how its done on the first java on template you pasted..................................

Re: How to add php code to side bar - please help

Posted: Thu Jul 16, 2009 9:11 pm
by Dee
If you want Javascript (or any code containing { or } ) inside your templates/pages to work, surround it with {literal} and {/literal}.
To add a PHP script, use a "User Defined Tag".

Kind regards,
D