Hi und guten Morgen, hat jemand von Euch bereits hinbekommen, dass in der Mobilephone (XS) Ansicht die Artikel 2-spaltig angezeigt werden? Das Problem ist bei nachfolgendem Code zu suchen, da hier jedes
doppelt von der Funktion ausgegeben wird. Wenn es mir gelänge, abzufragen, ob gerade ein Artikelelement kommt, dann wäre mir schon extrem geholfen, da ich dann vor {include file=“widgets/emotion/components/component_article.tpl”} einfach das entsprechenden DIV mit col-xs-6 setzen könnte. Vielleicht hat ja jemand noch eine Idee… Lieben Dank und viele Grüße, Chris [quote] {function name=draw element=null parent=null} {if $element.type == ‘row’ OR $parent === null}
{/if} {if $element.type == ‘col’} {if $parent === null} {assign “size” 12} {else} {assign var=“size” value=12 / ($parent.endCol - $parent.startCol + 1) * ($element.endCol - $element.startCol + 1)} {/if}
{/if} {foreach $element.elements as $drawElement} {* Massive calculation *} {$colWidth = ($drawElement.endCol - $drawElement.startCol) + 1} {$colHeight = ($drawElement.endRow - $drawElement.startRow) + 1} {$drawElementWidth = (($drawElement.endCol - $drawElement.startCol) + 1) * $cellWidth} {$drawElementHeight = (($drawElement.endRow - $drawElement.startRow) + 1) * $cellHeight} {$left = ($drawElement.startCol - 1) * $cellWidth} {$top = ($drawElement.startRow - 1) * $cellHeight} {$listingTpl = “listing-{$emotion.grid.cols}col”} {$template = $drawElement.component.template} {* Inner template vars *} {$Data=$drawElement.data} {$sArticle=$drawElement.data} {$sTemplate=$listingTpl} {$sColWidth=$colWidth} {$sColHeight=$colHeight} {$sElementHeight=$drawElementHeight-$emotion.grid.gutter} {$sElementWidth=$drawElementWidth-$emotion.grid.gutter} {$sCategoryId=$categoryId} {$sController=$Controller} {$sEmotionCols=$emotion.grid.cols} {block name=“widgets/emotion/index/inner-element”} {if $template == ‘component_article’}
{include file=“widgets/emotion/components/component_article.tpl”}
{elseif $template == ‘component_article_slider’} {include file=“widgets/emotion/components/component_article_slider.tpl”} {elseif $template == ‘component_banner’} {include file=“widgets/emotion/components/component_banner.tpl”} {elseif $template == ‘component_banner_slider’} {include file=“widgets/emotion/components/component_banner_slider.tpl”} {elseif $template == ‘component_blog’} {include file=“widgets/emotion/components/component_blog.tpl”} {elseif $template == ‘component_category_teaser’} {include file=“widgets/emotion/components/component_category_teaser.tpl”} {elseif $template == ‘component_html’} {include file=“widgets/emotion/components/component_html.tpl”} {elseif $template == ‘component_iframe’} {include file=“widgets/emotion/components/component_iframe.tpl”} {elseif $template == ‘component_manufacturer_slider’} {include file=“widgets/emotion/components/component_manufacturer_slider.tpl”} {elseif $template == ‘component_youtube’} {include file=“widgets/emotion/components/component_youtube.tpl”} {elseif “widgets/emotion/components/{$template}.tpl”|template_exists} {include file=“widgets/emotion/components/{$drawElement.component.template}.tpl”} {else} {* *} {/if} {/block} {* Get the last row to compute the final height of the emotion world *} {if $finalEndRow < $drawElement.endRow} {$finalEndRow=$drawElement.endRow} {/if} {/foreach} {foreach from=$element.children item=child} {draw element=$child parent=$element} {/foreach} {if $element.type == ‘row’ OR $parent === null}
{/if} {if $element.type == ‘col’}
{/if} {/function} {if $swfEmotions|@count > 0} {foreach $swfEmotions as $emotion} {draw element=$emotion} {/foreach} {/if} [/quote]