Page 1 of 1

Problem with printing content inside the {if $page_lang == "en_US"}{/if} blocks

Posted: Sun Apr 25, 2010 8:46 pm
by kardasa
EDIT: I'm chenging the subject to match real problem look at replay 3 {evel var } is not the real problem here,

I'm having a wierd problem, the printing module dosn't output anything that should be displayed by {eval var=''} smarty tag. This is a major problem as most of my content is being displayed by core news module and calgusy blog module. Every articule in there is blank after presing print. I have title and date but nothing else.
This was working when I was working on templates. Since then I did an update to php-5.3.1 and CMS Made Simple from 1.6.7 to 1.7. Today I noticed this problem and I'm bit lost, don't know what to do as printing is very important for me.
My configuration:
CMS Made Simple 1.7 with:News 2.10.4, Printing 1.0.4.
One of my template is looking like this:

Code: Select all

{* set a canonical variable that can be used in the head section if process_whole_template is false in the config.php *}
{if isset($entry->canonical)}
  {assign var='canonical' value=$entry->canonical}
{/if}
<div id="printing" class="noprint">
{cms_module module='printing' showbutton="true" script="true" popup="true" lang="en_US"} {cms_module module='printing' pdf="true" showbutton="true" lang="en_US"}
</div>
<h3 id="NewsPostDetailTitle" style=text-transform:none;>
{$entry->title|cms_escape:htmlall}</h3>
<p>
<div id="NewsPostDetailDate">
Published:
 {$entry->postdate|date_format:"%d.%m.%Y"}
</div>
</p>
<hr id="NewsPostDetailHorizRule" />

{if $entry->summary}
	<div id="NewsPostDetailSummary">
		<p><strong>
			{eva; var=$entry->summary}
		</strong></p>
	</div>
{/if}

<div id="NewsPostDetailContent">
	{eval var=$entry->content}
</div>
<br />
{if $return_url != ""}
<div id="NewsPostDetailReturnLink">
{$return_url}
</div>
And this is working perfectly on my site when I'm desplaing the details of the articule but when I press print i have:

Code: Select all

</__body>	
      <div class="noprint" id="printing">
</div>
<h3 style="text-transform: none;" id="NewsPostDetailTitle">package-1.1.43-r1</h3>
<p>
</p><div id="NewsPostDetailDate">
Published: 

21.04.2010
</div>

<hr id="NewsPostDetailHorizRule">

	<div id="NewsPostDetailSummary">
		<p><strong>
			
		</strong></p>
	</div>

<div id="NewsPostDetailContent">
	
</div>
<br>
<div id="NewsPostDetailReturnLink"></div>
As you can see all {eval var=''} from template are not being displayed.
I will be greatful for any help, suggestion. I can provide more detailed info if needed.

Re: Problem with printing eval smarty values in CMSMS 1.7

Posted: Sun Apr 25, 2010 9:13 pm
by calguy1000
This is strange.

You should either get
a) your original content
b) the smarty parsed content
but not nothing...

so I tested this, and sure enough it works fine for me.
so there must be something else in your configuration that's messing something up.

Re: Problem with printing eval smarty values in CMSMS 1.7

Posted: Sun Apr 25, 2010 9:52 pm
by kardasa
Thanks for your answer.
calguy1000 wrote: This is strange.
so there must be something else in your configuration that's messing something up.
First i created the blog part of my page using cgblog in cmsms 1.6.7 and printing was working right. Then I updated both php and cmsms. Then I created the new part using news module. I worked on this for some time and created some content. Today when I pressed print I noticed this wired problem. It happened both for my blog content and the one created with core news. I must clearly point that I did not change a single line in blog templates since i made the changes first time (it was working then). I just wonder could it be someting with php? If so why is it working in view mode, page is displaying perfectly fine only print module is messing with output.
To be more specific I did two more things. I installed geshi into lib and I unnistaled tinymce (using module administation in CMS) because it was messing my code and I couldn't  get rid of it in news module the other way. Is it possible this is messing something?

My site is still under development but you can see it for yourself (link to both news and blog examples are availble on home page), and press print for any article this is in fact very strange. http://www.kardasa.pl/english/home.html

edit:
I did one more thing I enabled preaty urls to make rss feed working (w/o they wasn't working)

Re: Problem with printing eval smarty values in CMSMS 1.7

Posted: Mon Apr 26, 2010 7:50 pm
by kardasa
After half day of testing all I was able to test I found out what is coising this problem.
I'm running two langiage site (using babel module). The problem is coused by the fact that every article on my site is being written inside of:

Code: Select all

  {if $page_lang == "en_US"}English{elseif $page_lang == "pl_PL"}Po polsku{/if} blocks
And this is main problem here. First I thought that the language variable is not passed to the print page template but it is when i put the mentioned above block into the print template above the:

Code: Select all

{$content}
line, The message "English" or "Po polsku" is printed out,
I was trying

Code: Select all

{eval var=$content}
but the result is the same every thing inside if else language block in article is not printed out. Maybe some one can suggest some good solution to this problem, except writing every article 2 times.