|
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 |
Karel S. Smarty Rookie
Joined: 03 Aug 2009 Posts: 26 Location: The Netherlands
|
Posted: Fri Sep 25, 2009 8:15 am Post subject: Strip doesn't work always? |
|
|
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}:
{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: Agena , CPU-voet: Socket AM2+ , Klokfrequentie: 2.2 GHz |
The problem is that I can't place the comma direct after the spec value:
|
|
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
|