ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Best Way To Deal With External Links? (2 Questions)

November 28, 2012 12:50am

Subscribe [2]
  • #1 / Nov 28, 2012 12:50am

    nyc

    66 posts

    I’m trying to allow my client to enter up to 5 links so I have the following code:

    <ul id="links">
     <li>{link_1}</li>
     <li>{link_2}</li>
     <li>{link_3}</li>
     <li>{link_4}</li>
     <li>{link_5}</li>
    </ul>

    Questions

    1. Whats the simplest way to set this up for my client so all they have to do is type the word in the field like “google” , highlight the words and add a link so it will link to “http://google.com”?  Is there a field type specifically for links so nothing will be added but the anchor?

    2. The code above works for displaying the links, but not all of the links will be added all the time but I’ll still be left with blank list items. If there is no link in #4 or #5, how do I stop it from displaying the <li> </li> for both of those fields?

     

  • #2 / Nov 28, 2012 2:59am

    Wouter Vervloet

    758 posts

    1. I don’t think there is something like an autocompleting URL field available, but you can use something like JCO URL to make sure they add a valid URL.

    2. It’s pretty easy actually:

    {if link_4}<li>{link_4}</li>{/if}

    – Wouter

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases