Support Forums

MODIFICATION: Display extra fields separately.

This is a discussion on MODIFICATION: Display extra fields separately. within the Modules / Plugins / Modifications forums, part of the Developer Forums category; Step 1. Go to your administration -> extra fields and note the id of the extra field. Step 2. Open ...


Go Back   68 Classifieds Forums > Developer Forums > Modules / Plugins / Modifications

Reply
 
Thread Tools Display Modes
Old 02-28-2008, 12:13 AM   #1
Senior Member
 
cwp's Avatar
 
Join Date: Jun 2007
Posts: 296
Rep Power: 21
cwp is a jewel in the rough
Default MODIFICATION: Display extra fields separately.

Step 1. Go to your administration -> extra fields and note the id of the extra field.

Step 2. Open the viewlisting template file add this code to the top of the template file replacing 4 with the id from step 1:

Step 3: Now change the word name to whatever you want.

Code:
{foreach from=$extrafields item=extras}
        {if $extras.fID==4} 
            {foreach key=key item=item from=$extras.value}
                {assign var="name" value="$item"}
            {/foreach}
        {/if}
    {/foreach}
Step 3: Now you can use {$name} wherever you want to on the viewlisting.tpl template.


In order to display a extra field by itself with the field type of "check boxes" in the viewlisting template use this code where you want it to be displayed:

Code:
{foreach from=$extrafields item=extras}
{if $extras.fID==1} 
{foreach key=key item=item from=$extras.value}
{$item}<br />
{foreachelse}
{$extras.value}
{/foreach}
{/if}
{/foreach}
There may be an easier way of doing the extra fields with the field type of "check boxes" but this method works for now.

Credit goes to Suzkaw.
__________________
Version 4.0.3 Developer
cwp is offline   Reply With Quote
Old 05-29-2008, 04:30 PM   #2
Senior Member
 
Join Date: Jun 2007
Posts: 110
Rep Power: 17
crystal is on a distinguished road
Default

I've been looking for a way to put my extra fields seperately in the listing. Would I need to define a 'name' for each extra field individually (so copy all the code in the {foreach} tags for each extra field)?

Thanks!
__________________
Crystal
v4.0.8 Dev
crystal is offline   Reply With Quote
Old 05-30-2008, 03:20 PM   #3
Senior Member
 
cwp's Avatar
 
Join Date: Jun 2007
Posts: 296
Rep Power: 21
cwp is a jewel in the rough
Default

I've been looking for a way to put my extra fields seperately in the listing.

Then this mod will work perfectly for you.


Would I need to define a 'name' for each extra field individually (so copy all the code in the {foreach} tags for each extra field)?

Nope, just make sure you have the id's correctly.
__________________
Version 4.0.3 Developer
cwp is offline   Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Display extra fields by themselves? cwp Technical Support 3 02-22-2008 04:34 AM


All times are GMT -4. The time now is 04:21 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0