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.

Doing something wrong with links

August 27, 2007 7:18pm

Subscribe [3]
  • #1 / Aug 27, 2007 7:18pm

    Gary Chapman

    107 posts

    I’m trying to create a link directory using blog entries as the individual links, with a directory by category. I’m using the following tag sequence:

    {entry_titles}
    <a href="http://{link_url}">{title}</a>
    {/entry_titles}

    The “link_url” is a custom field, and simply contains the Web link address, entered in the publish form.

    But I’m getting a link on the page that is “http://{link_url}”. I know I’m doing something wrong that’s probably a simple fix, but I could use some help.

    Thanks.

  • #2 / Aug 27, 2007 7:25pm

    Lisa Wess

    20502 posts

    Can you show us the rest of the tag? I suspect it’s the category archives tag, which doesn’t take custom fields.  You might check out this wiki entry =)

  • #3 / Aug 27, 2007 8:25pm

    Gary Chapman

    107 posts

    Can you show us the rest of the tag? I suspect it’s the category archives tag, which doesn’t take custom fields.

    You’re right, that’s the problem.

    I’ll study the wiki entry you pointed me to, thanks.

  • #4 / Aug 27, 2007 10:41pm

    Gary Chapman

    107 posts

    Hmmmm. . . .

    This still isn’t working, even though it seems to fit the syntax of the code example on the wiki entry:

    {exp:weblog:category_archive weblog="links" show_empty="no"}
    {categories}
    <h3>{category_name}</h3>
    <p>{exp:weblog:entries weblog="links" orderby="title" category="{category_id}" sort="asc" limit="15" }<br />
    <a href="http://{link_url}">{title}</a><br />
    {/exp:weblog:entries}<br />
    {/categories}<br />
    {/exp:weblog:category_archive}

    For the link attached to {title}, I’m still getting an invalid URL. (Once again, {link_url} is a custom field.)

  • #5 / Aug 27, 2007 10:58pm

    Sue Crocker

    26054 posts

    Double check that you have turned off automatic linking of URLs.

    From the docs:

    Automatically turn URLs and email addresses into links?

    When this option is set to “Yes”, any full URLs or email addresses will be automatically formatted as a valid HTML link to the address. If the option is “No” then the URL or email address will be treated and displayed as plain text

  • #6 / Aug 27, 2007 11:16pm

    Gary Chapman

    107 posts

    Double check that you have turned off automatic linking of URLs.

    Thanks, that fixed a formatting issue of the text on the page, but I’m still not getting valid URLs. I tweaked the code, as per the wiki entry, to this:

    {exp:weblog:categories weblog="links" style="linear" show_empty="no"}
    <h3>{category_name}</h3>
    <p>{exp:weblog:entries weblog="links" category="{category_id}"}<br />
    <a href="http://{link_url}">{title}</a></p>
    
    <p>{/exp:weblog:entries}</p>
    
    <p>{/exp:weblog:categories}

    The field “link_url” is a custom field that simply contains the URL of the site I’m trying to link to.

    The page is here: http://www.21stcenturyproject.org/index.php/site/links/

    You can see the problem with the links toward the bottom, under the subhead “Links by Category.”

  • #7 / Aug 28, 2007 1:39am

    Derek Jones

    7561 posts

    What you are seeing is a URL encoded version of:

    <a href="http://www.21stcenturyproject.org/index.php/site/links/http://googlepublicpolicy.blogspot.com/">http://www.21stcenturyproject.org/index.php/site/links/http://googlepublicpolicy.blogspot.com/</a>

    The paragraph tags indicate that the custom field has typographical formatting applied.  If you go into the custom field administration, you will want to set the formatting type to “None”, making sure to check the box to apply it to all existing entries as well.

  • #8 / Aug 28, 2007 8:51am

    Gary Chapman

    107 posts

    The paragraph tags indicate that the custom field has typographical formatting applied.  If you go into the custom field administration, you will want to set the formatting type to “None”, making sure to check the box to apply it to all existing entries as well.

    That fixed it! Thanks so much. I knew there was something that I was doing wrong, and that was an easy fix, thanks a lot, you guys are great.

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

ExpressionEngine News!

#eecms, #events, #releases