Support Forums

How to make an extra field a link

This is a discussion on How to make an extra field a link within the Modules / Plugins / Modifications forums, part of the Developer Forums category; If you create an extra field that allows a url to be entered then this will hopefully help explain how ...


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

Reply
 
Thread Tools Display Modes
Old 05-12-2008, 02:37 PM   #1
68 Classifieds Staff
 
Eric Barnes's Avatar
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,467
Rep Power: 130
Eric Barnes is just really nice Eric Barnes is just really nice
Default How to make an extra field a link

If you create an extra field that allows a url to be entered then this will hopefully help explain how to do it.

Step 1 - Create the extra field in administration and then write down or remember the field id.

Step 2 - Open the viewlisting.tpl template file and locate:
Code:
{foreach from=$extrafields item=extras}
<tr>
    <td><strong>{$extras.title}:</strong></td>
    <td>
        {if isset($extras.value)}
            {foreach key=key item=item from=$extras.value}
                {$item}<br />
            {foreachelse}
                {$extras.value}
            {/foreach}
        {/if}
    </td>
</tr>
{/foreach}
Next replace it with this:
Code:
{foreach from=$extrafields item=extras}
<tr>
    <td><strong>{$extras.title}:</strong></td>
    <td>
        {if isset($extras.value)}
            {foreach key=key item=item from=$extras.value}
                {if $extras.fID==1} {* 1 is the id you got from step 1 *}
                {$item|linkurl:30}
                {else}
                {$item}<br />
                {/if}
            {foreachelse}
                {$extras.value}
            {/foreach}
        {/if}
    </td>
</tr>
{/foreach}
Here is a quick movie showing how to edit it:
http://www.68classifieds.com/knowled...isting-url.mov
__________________
Eric Barnes
68 Classifieds Developer
Customer Area | Issue Tracker | Documentation | 68C Mods | 68 @ Twitter | My Modules

Last edited by Eric Barnes; 05-12-2008 at 02:59 PM.
Eric Barnes is offline   Reply With Quote

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