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

Strip doesn't work always?

 
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 -> Smarty 3
View previous topic :: View next topic  
Author Message
Karel S.
Smarty Rookie


Joined: 03 Aug 2009
Posts: 26
Location: The Netherlands

PostPosted: Fri Sep 25, 2009 8:15 am    Post subject: Strip doesn't work always? Reply with quote

Got some code for printing product specs:

Code:

{if $SpecValues && $aPrimarySpecs}
{strip}
        <h4>
{foreach $aPrimarySpecs as $aSpec}
    {if $SpecValues[$iProductId][$aSpec.iSpecId].sSpecValue}
          {if !$aSpec@first}, {/if}{$aSpec.sSpecName}:&nbsp;
          {assign var="value" value=$SpecValues[$iProductId][$aSpec.iSpecId].sSpecValue}
       {if $aSpec.iSpecType == $smarty.const.TYPE_MULTIPLE_CHOICE}
          {assign var="mcvalue" value=$MCOptions[$value].sMcName}
          {if $mcvalue == "-"}<img src="{$aConfig.Path.icons}cross.png" alt="{$aGuiTexts.Boolean_No}" />{elseif $mcvalue}{$mcvalue}{else}?{/if}
       {elseif $aSpec.iSpecType == $smarty.const.TYPE_BOOLEAN}
          {if $value == 1}{$aGuiTexts.Boolean_Yes}{else}{$aGuiTexts.Boolean_No}{/if}
       {elseif $aSpec.iSpecType == $smarty.const.TYPE_NUMBER}
          {section name="test" loop=$value start=0}<img src="{$aConfig.Path.images}star.gif" alt="" />{/section}
       {elseif $value == "-"}
          {$aGuiTexts.Boolean_No}
       {elseif $value && $aSpec.iUnitId == $smarty.const.UNIT_EURO}
          {$Units[$aSpec.iUnitId].sUnitName} {$value}
       {elseif $value}
          {$value} {$Units[$aSpec.iUnitId].sUnitName}
       {/if}
    {/if}
{/foreach}
        </h4>
{/strip}
{/if}


The html output:

Code:
<h4>CPU-core:&nbsp;Agena                         , CPU-voet:&nbsp;Socket AM2+                         , Klokfrequentie:&nbsp;2.2 GHz


The problem is that I can't place the comma direct after the spec value:

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 -> Smarty 3 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