# Wie kann ich einen Datei in der box-basic.tpl in einer If-Schleife ausgeben lassen?

**URL:** <https://forum.shopware.com/t/wie-kann-ich-einen-datei-in-der-box-basic-tpl-in-einer-if-schleife-ausgeben-lassen/35380>\
**Category:** Programmierung\
**Created:** [18. März 2016 um 10:41 UTC](https://forum.shopware.com/t/wie-kann-ich-einen-datei-in-der-box-basic-tpl-in-einer-if-schleife-ausgeben-lassen/35380 "2016-03-18T10:41:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![CrazyM](https://avatars.discourse-cdn.com/v4/letter/c/a698b9/32.png) [@CrazyM](https://forum.shopware.com/u/CrazyM)\
**Post date:** [18. März 2016 um 10:41 UTC](https://forum.shopware.com/t/wie-kann-ich-einen-datei-in-der-box-basic-tpl-in-einer-if-schleife-ausgeben-lassen/35380/1 "2016-03-18T10:41:57Z")

</div>

Moin Leute,

ich möchte ein Datei (product-infotable.tpl) in der box.basic.tpl, über eine if-Schleife anzeigen lassen. Könnt ihr mal rüber schauen, evtl habe ich was falsch gemacht.

Die product-infotavle.tpl habe ich selber geschrieben. De Datei soll nur eungezeigt werden, wenn in der Kategorie angezeigt werden, sonst nicht.

Ich weiß nicht mehr genau, wie ich die Schleife schreiben muss.

Code in der box-basic.tpl:

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;

Code der product-infotable.tpl:

{namespace name=„frontend/listing/box\_article“}  
{block name=„frontend\_listing\_box\_article\_infotable“}  
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;  
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&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bsp;&nbsp;&nbsp; &nbsp;|&nbsp;&nbsp; &nbsp;  
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; Farbe: |  
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; {$sArticle.attr6} |  
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;|&nbsp;&nbsp; &nbsp;  
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; Typ: |  
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; {$sArticle.attr10} |  
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;  
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;

&nbsp;&nbsp; {/block}

---

<div class="post-metadata">

**Author:** ![CrazyM](https://avatars.discourse-cdn.com/v4/letter/c/a698b9/32.png) [@CrazyM](https://forum.shopware.com/u/CrazyM)\
**Post date:** [18. März 2016 um 10:46 UTC](https://forum.shopware.com/t/wie-kann-ich-einen-datei-in-der-box-basic-tpl-in-einer-if-schleife-ausgeben-lassen/35380/2 "2016-03-18T10:46:48Z")

</div>

Ups Fomratierungsfehler

Schleife in der box-basic

```
                        {* Product name *}
                        {block name='frontend_listing_box_article_name'}
                             
                                {$sArticle.articleName|truncate:50}
							
				    
       				 
					
                            
                        {/block}

```

produt-infotable.tpl:

```
{namespace name="frontend/listing/box_article"}
{block name="frontend_listing_box_article_infotable"}
				
				   
						
					Rollenbreite:
					{$sArticle.attr4}
					
						
					∅ Rolle:
					{$sArticle.attr5}
					
						
					Laufl&aumlnge:
					{$sArticle.attr8}
					
						
					∅ Kern:
					{$sArticle.attr7}
					
						
					Papier:
					{$sArticle.attr9}
					
						
					Farbe:
					{$sArticle.attr6}
					
						
					Typ:
					{$sArticle.attr10}
					
				   
				
   {/block}

```

&nbsp;

---

<div class="post-metadata">

**Author:** ![sonic](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/sonic/32/25728_2.png) [@sonic](https://forum.shopware.com/u/sonic)\
**Post date:** [18. März 2016 um 10:49 UTC](https://forum.shopware.com/t/wie-kann-ich-einen-datei-in-der-box-basic-tpl-in-einer-if-schleife-ausgeben-lassen/35380/3 "2016-03-18T10:49:45Z")

</div>

```
{if $productBoxLayout == 'minimal'}
  {include file="frontend/listing/product-box/product-infotable.tpl"}
{/if}

```

Template-/ Smarty-Anweisung werden in geschweiften Klammern angegeben.

---

<div class="post-metadata">

**Author:** ![CrazyM](https://avatars.discourse-cdn.com/v4/letter/c/a698b9/32.png) [@CrazyM](https://forum.shopware.com/u/CrazyM)\
**Post date:** [18. März 2016 um 10:53 UTC](https://forum.shopware.com/t/wie-kann-ich-einen-datei-in-der-box-basic-tpl-in-einer-if-schleife-ausgeben-lassen/35380/4 "2016-03-18T10:53:06Z")

</div>

Achso alles klar, viele Dank.
