Page 1 of 1

[SOLVED] CGfeedback extra field: website

Posted: Wed Feb 03, 2010 7:08 pm
by Elise
I'm making a blog with the latest versions of CGBlog, CGFeedback, CGExtensions and CGSimpleSmarty.
In the CGFeedback form I created 2 extra field: one in which the visitor can fill in in which country he/she is living and one in which they can fill in their own website. Now I would like to make the website appear as a link. For this I changed the CGFeedback form-template:

Code: Select all

{if isset($one.fields)}    
      {foreach from=$one.fields key='name' item='field'}
{if $name == "Website" }
      <div class="feedback_item_field">
Website: <a href="{$field.value}">{$field.value}</a>
      </div>
{if $name == "Country" }
<div class="feedback_item_field">
Country: {$field.value}
      </div>
{/if}
      {/foreach}
    {/if}
This is working fine, but if the visitor doesn't fill in http:// before their url, my root-url is put in front of the visitors url, and then the link doesn't work of course.
Does someone have a solution for this?

Re: CGfeedback extra field: website

Posted: Wed Feb 03, 2010 7:12 pm
by JeremyBASS
try this...


{$field.value}

this will filter out the http:// if they put it in.. so now you hard code the http:// back in.. hope this helps.. Cheers
jeremy

Re: CGfeedback extra field: website

Posted: Wed Feb 03, 2010 8:24 pm
by Elise
Works great, thank you!  :D

Re: [SOLVED] CGfeedback extra field: website

Posted: Wed Feb 03, 2010 8:40 pm
by JeremyBASS
No prob.. it's good karma for the soul.. Cheers  ;D