• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: [SOLVED] Smarty variable is empty in </__body>
PostPosted: Mon Feb 04, 2013 9:07 am 
Offline
Forum Members
Forum Members

Joined: Thu Jan 14, 2010 4:43 pm
Posts: 24
Hi,
i'm struggling with smarty variable scope, although I believe it should be straightforward...

I use cmsms 1.11.4 on Ubuntu 12.04 LTS with php 5.3.10

This Page template produces a page with 456, when I expect 123456
The <head> does contain the 123 comment as expected.

{process_pagedata}<!DOCTYPE html>
<__html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
<head>
{$test="123"}
<!-- {$test} -->
</head>
</__body>
{content assign="notused"}
{$test}456
<__body>
</__html>

Can anybody else reproduce this behaviour and maybe help me understand it?

Thank you very much.


Last edited by atz6975 on Mon Feb 04, 2013 2:36 pm, edited 2 times in total.

Top
 Profile  
 
 Post subject: Re: Smarty variable is empty in </__body>
PostPosted: Mon Feb 04, 2013 11:06 am 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Fri Nov 30, 2007 9:15 am
Posts: 340
Dear atz6975,

The reason for this is the "processing order".

You can read more about it here:
http://www.i-do-this.com/blog/75/Under- ... -Templates

Try defining the var at the top of the body instead of inside the head.

Greetings,
Manuel

_________________
Do you like your open source cms? Buy from the CMSMS partners || Donate
(or at least share some knowledge :D >> See some of my stuff )


Top
 Profile  
 
 Post subject: Re: [SOLVED] Smarty variable is empty in </__body>
PostPosted: Mon Feb 04, 2013 2:36 pm 
Offline
Forum Members
Forum Members

Joined: Thu Jan 14, 2010 4:43 pm
Posts: 24
YES!
Thank you very much.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users


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 post attachments in this forum

Search for:
Jump to:  
Arvixe - A CMSMS Partner