|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
me2 Smarty n00b
Joined: 13 Aug 2009 Posts: 3
|
Posted: Fri Aug 28, 2009 2:15 pm Post subject: OR and calculations? |
|
|
I used to do something like this to generate some cropped pagination:
Code: | {section name=paginas loop=$iMaxPages}
{if $smarty.section.paginas.iteration < 14
|| $smarty.section.paginas.iteration > ($iMaxPages - 10)
|| ($smarty.section.paginas.iteration >= $iCurrentPage - 1 && $smarty.section.paginas.iteration <= $iCurrentPage + 1)}
<li><a {if $smarty.section.paginas.iteration == $iCurrentPage}class="currentpage"{/if} href="{$url}{$smarty.section.paginas.iteration}">{$smarty.section.paginas.iteration}</a></li>
{elseif $smarty.section.paginas.iteration == 14 && ($iCurrentPage - 14) > 0
|| $smarty.section.paginas.iteration == ($iMaxPages - 10)}
<li>...</li>
{/if}
{/section} |
But with Smarty3 this gives me the following error:
Code: | Code: 0
Error: Syntax Error in template "/var/.../xxx.html" on line 25 " || $smarty.section.paginas.iteration > ($iMaxPages - 10)" - Unexpected " ", expected one of: "}" , "(&&,AND)" , "(||,OR)" , ISODD , ISNOTODD , ISEVEN , ISNOTEVEN , ISODDBY , ISNOTODDBY , ISEVENBY , ISNOTEVENBY , ISDIVBY , ISNOTDIVBY
File: /var/.../Smarty3Alpha/distribution/libs/sysplugins/internal.templatecompilerbase.php
Line: 264 |
Is this because of some syntax changes in Smarty3 or is this a bug? I hope it's a bug that's gonna get fixed! |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Fri Aug 28, 2009 6:38 pm Post subject: |
|
|
A fix for linebreaks inside {if} tags is in the SVN now |
|
Back to top |
|
Karel S. Smarty Rookie
Joined: 03 Aug 2009 Posts: 26 Location: The Netherlands
|
Posted: Mon Aug 31, 2009 12:22 pm Post subject: |
|
|
And it works, thanks. |
|
Back to top |
|
|
|
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
|