eSyndiCat User Forums esyndicat directory software esyndicat support

Go Back   eSyndiCat User Forums > International > German

German Lassen Sie uns Deutsches sprechen :)

Reply
 
Thread Tools Display Modes
Old 08-08-2009   #1
JoergL
 
Join Date: May 2006
Posts: 15
JoergL has disabled reputation
Default Einzelnes Listingfield

Ich möchte gerne im view-listing.tpl ein Listing-Field einzelnd ansprechen. Im regulären Template läuft das ja über die Passage

################################################## #######
{foreach from=$fields item=field}
{if ($field.name neq 'url') && ($field.name neq 'description') && ($field.name neq 'title')}
{assign var="key" value=$field.name}
<tr>
{assign var="field_name" value='field_'|cat:$field.name}
<td style="width: 20%;"><strong>{$lang.$field_name}:</strong></td>
<td>
{if $listing.$key || ($listing.$key eq '0')}
{if ($field.type eq 'text') || ($field.type eq 'textarea') || ($field.type eq 'number')}
{if $config.html_tags}
{$listing.$key|replace:"\r\n":"<br />"}
{else}
{$listing.$key|escape:"html"}
{/if}
{elseif $field.type eq 'checkbox'}
{arrayToLang values=$listing.$key name=$field.name}
{elseif $field.type eq 'storage'}
<a href="{$config.base}{$config.dir}uploads/{$listing.$key}">{$lang.download}</a>
{elseif $field.type eq 'image'}
<img src="{$config.base}{$config.dir}uploads/{$listing.$key}" {* width="{$field.image_width}" height="{$field.image_height}"*} />
{elseif $field.type eq 'combo'}
{assign var="field_combo" value="field_"|cat:$field.name|cat:'_'|cat:$listin g.$key}
{$lang.$field_combo}
{elseif $field.type eq 'radio'}
{assign var="field_radio" value="field_"|cat:$field.name|cat:'_'|cat:$listin g.$key}
{$lang.$field_radio}
{/if}
{else}
{$lang.not_available}
{/if}
</td>
</tr>
{/if}
{/foreach}
################################################## #######

mit diesem Code habe ich aber wenig Möglichkeiten, die einzelnen Inhalte zu ordnen und anders darzustellen.


Bei einfachen Textfeldern ist das alles kein Problem und wird so gelöst:

{if $listing.NAME}{$listing.NAME}{/if}


Was tue ich aber bei sog. Combofields, welche mehrer Inhalte über ID's haben:

Bei mir gibt es z.B. das Feld Kreditkraten ($listing.creditcards), darunter gibt es dann

0 = VISA
1 = AMEX
2 = Mastercard
3 = EC

Wenn ich bei einem solchen Feld {if $listing.creditcards}{$listing.creditcards}{/if} im Template benutze, dann wird folgendes ausgegeben:

0,1,2,3

Ich möchte jetzt das für jeden Eintrag folgendes auf der Listingseite erscheint:

<li>VISA</li>
<li>AMEX</li>

Es muss auch etwas mit "foreach" zu tun haben, aber ich bekomme es nicht hin.

Weiss einer Rat oder kann mein Problem mal ins englische Forum reinstellen (mein englisch
ist eher poor).

Danke, Thanks

Jorge
__________________
DO NOT SEND SPAM
Fruehbucher Blog
JoergL is offline   Reply With Quote
Old 08-09-2009   #2
clickme4
 
Join Date: Nov 2006
Posts: 46
clickme4 is on a distinguished road
Default

Think I understand what you are trying to do.
Something I was working on might help.
Quote:
<tr>
{if $listing.creditcards}
{$listing.creditcards|replace:',':''|replace:'1':' <img src="images/visa_logo_3.gif" border="0" alt="Visa"><br />'|replace:'2':'<img src="images/mastercard_logo_3.gif" border="0" alt="Mastercard"><br />'|replace:'3':'<img src="images/american_express_logo_3.gif" border="0" alt="American Express"><br />'|replace:'4':'<img src="images/discover_logo_3.gif" border="0" alt="Discover"><br />'|replace:'5':'<img src="images/paypal_logo.gif" border="0" alt="PayPal"><br />'}
{/if}
</tr>
clickme4 is offline   Reply With Quote
Old 08-15-2009   #3
JoergL
 
Join Date: May 2006
Posts: 15
JoergL has disabled reputation
Default

Thanks clickme4, I use this solution at the moment, but there must be an easier way.
__________________
DO NOT SEND SPAM
Fruehbucher Blog
JoergL is offline   Reply With Quote
Old 08-16-2009   #4
JoergL
 
Join Date: May 2006
Posts: 15
JoergL has disabled reputation
Default

If you have more than 10 elements or using numbers like 24h in the element description you will have a problem by using replace.
JoergL is offline   Reply With Quote
Reply

Tags
listing display, listing fields, single line

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 05:00 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Testimonials | Articles | Support | Documentation | Privacy Policy | License | Affiliates | Contact Us | SEO Resources