1

Topic: Live URLs

I'm using text fields for users to put URLs for links to outside sites. Is there a way to have these be "live" so the users do not have to cut and past the links and can just click on them?

2

Re: Live URLs

You can edit a template file where you display those links and customize it to make those links clickable.

3

Re: Live URLs

Those links display in their public profile. How do I go about customizing it to make those clickable? Any help on the coding end would be awesome.

4

Re: Live URLs

<a href="{virtual_path}{member_username}">{virtual_path}{member_username}</a>
try this

5

Re: Live URLs

radioact wrote

<a href="{virtual_path}{member_username}">{virtual_path}{member_username}</a>
try this

Thanks! One more quick one. I have 5 different text fields where I'd like to apply this. Will this make all links live for each individual field?  Where do I stick this in the member_profile.tpl?

An example of what I'm trying to do is here: http://www.drummerhunter.com/crockus/ under the "myspace/youtube/website" tab.

thanks for all the help.

6

Re: Live URLs

Find {field_value} in member_profile.tpl template file and replace it with:

<!-- IF field_label = "url_field_label_1" OR field_label = "url_field_label_1" -->
  <a href="http://{field_value}">{field_value}</a>
<!-- ELSE -->
  {field_value}
<!-- ENDIF -->

Replace "url_field_label" with your fields' labels you use for links (for example if you used "youtube" for youtube link, use that).

7

Re: Live URLs

Thank you! I assume I need to repeat this for each field? Below is how i am going to insert this code, repeated twice for two separate fileds. Is this correct?

<!-- BEGIN profile_fields -->
<dt>{field_name}:</dt>
<dd>
<!-- IF field_value -->
<!-- IF field_type == "checkbox" -->
{break:field_value}
<!-- IF field_label = "myspace" OR field_label = "myspace" -->
<a href="http://{field_value}">{field_value}</a>
<!-- IF field_label = "website" OR field_label = "website" -->
<a href="http://{field_value}">{field_value}</a>
<!-- ELSE -->
{field_value}
<!-- ENDIF -->
<!-- ELSE -->

8

Re: Live URLs

Yes, that's correct. You could've also done this:

<!-- IF field_label = "myspace" OR field_label = "myspace" OR field_label = "website" -->
  <a href="http://{field_value}">{field_value}</a>
<!-- ELSE -->
  {field_value}
<!-- ENDIF -->

9

Re: Live URLs

I am now getting this error.

Parse error: syntax error, unexpected $end in /home/drummerh/public_html/templates/webby2/tmp/member_profile_tpl.php on line 182

I used a basic text editor to alter the file and alleviate the risk of an html editor throwing in some wacky code bit.

Have I missed something?

my coding for 5 individual text fields was:

<!-- IF field_label = "myspace1" OR field_label = "myspace2" OR field_label = "youtube" OR field_label = "youtube1" OR field_label = "website"-->
  <a href="http://{field_value}">{field_value}</a>
<!-- ELSE -->
  {field_value}
<!-- ENDIF -->

10

Re: Live URLs

At the very end of your first line, you are missing a space between double quote and --> characters.

11

Re: Live URLs

I have added the space as you instructed and I still continue to get an error? I remove the arrow and I don't get an error but I also don't get any clickable links. I'm not sure what to do next?

12

Re: Live URLs

Please copy/paste that code right from your source into text area here encapsulated in

'code' tags and I try to help you.

Last edited by radioact (2008-02-27 23:31:51)

13

Re: Live URLs

Vlad/ Radioact/drummerhunter: Isn't "website" a label used in the script??
Perhaps you need to use another label...("yourwebsite")
This is proberly not the problem, but perhaps you'll get problems there too...

14

Re: Live URLs

radioact wrote

Please copy/paste that code right from your source into text area here encapsulated in

<!-- BEGIN profile_fields -->

                                                <dt>{field_name}:</dt>

                                                <dd>

                                                    <!-- IF field_value -->

                                                    <!-- IF field_type == "checkbox" -->

                                                            {break:field_value}
<!-- IF field_label = "myspace1" OR field_label = "myspace2" OR field_label = "youtube" OR field_label = "youtube2" OR field_label = "website" -->
  <a href="http://{field_value}">{field_value}</a>

                                                         <!-- ELSE -->

                                                            {field_value}

                                                        <!-- ENDIF -->

                                                    <!-- ELSE -->

                                                        &nbsp;

                                                    <!-- ENDIF -->

                                                </dd>

                                            <!-- END profile_fields -->

'code' tags and I try to help you.

15

Re: Live URLs

Try this:

<!-- BEGIN profile_fields -->

             <dt>{field_name}:</dt>

                      <dd>

                     <!-- IF field_value -->

                           <!-- IF field_type == "checkbox" -->

                               {break:field_value}
                            <!-- ELSE -->
                                       <!-- IF field_label = "myspace1" OR field_label = "myspace2" OR field_label = "youtube" OR field_label = "youtube2" OR field_label = "website" -->
  <a href="http://{field_value}">{field_value}</a>
                                      <!-- ELSE -->
                                        {field_value}
                                    <!-- ENDIF -->
                            <!-- ENDIF -->
                    <!-- ELSE -->

                             &nbsp;

                    <!-- ENDIF -->

                     </dd>

<!-- END profile_fields -->

Writing a code try to keep indents and you'll be able to find bug places much faster.

16

Re: Live URLs

P.S.: Every IF must have it's ENDIF wink

17

Re: Live URLs

I will, today.  Thank you for taking a look at it.