PDA

View Full Version : Changing display URL


Stephen Young
08-05-2006, 09:46 PM
Hi All

Just having a play around with the script, what I needed was to change text shown for certain links. Ie to show http://www.domain.com/product_name instead of http://www.domain.com/cat/display?product_id=1234

I created an extra admin only field 'display_url' not shown by default on any page which defaults to 'null' when entering a link unless I decide that the link text should change and enter a more friendly url

Just a question, from what I see it seems to work fine although will this cause me any problems in the future? and does this need changing elsewhere?

Changes were:

In link-display.tpl
<div class="url">
{if $link.display_url}
{$link.display_url}
{else}
{$link.url}
{/if}
</div>

In view-link.tpl
{foreach from=$fields item=field}
{assign var="key" value=$field.name}
<tr>
<td><strong>{$lang.$key}:</strong></td>
<td>
{if $link.$key}
{if $field.type eq 'textarea' AND $config.esc_codes}
{text_to_html aText=$link.$key aParagraph=true}
{elseif $field.type eq 'checkbox'}
{array_to_lang values=$link.$key}
{else}
{if ($link.$key eq $field.default) AND (($field.type neq 'textarea') AND ($field.type neq 'text'))}
{assign var="lang_key" value=$field.default}
{$lang.$lang_key}
{else}
{if ($field.type neq 'textarea') AND ($field.type neq 'text')}
{assign var="lang_key" value=$link.$key}
{$lang.$lang_key}
{else}
{if ($key eq url) AND ($link.display_url)}
{$link.display_url}
{else}
{$link.$key}
{/if}
{/if}
{/if}
{/if}
{else}
{$lang.not_available}
{/if}
</td>
</tr>
{/foreach}

WTM
08-05-2006, 10:11 PM
Thank you, Stephen for inventing a wheel... :applause:

This is exactly why we ask new users to spend some time reading through the forum...

http://www.esyndicat.com/forum/about5557.html

Stephen Young
08-06-2006, 12:24 AM
Thank you, Stephen for inventing a wheel... :applause:

This is exactly why we ask new users to spend some time reading through the forum...

http://www.esyndicat.com/forum/about5557.html

That link doesn't work... are you saying its already a feature? :bum-bum:

Greg
08-06-2006, 12:35 AM
That link doesn't work... are you saying its already a feature? :bum-bum:
That link goes to "eSyndiCat Pro customers" if you have ProVersion you need to have Simon give you access rights to it.