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.

Links are getting prepended by the site URL...

March 30, 2011 3:02pm

Subscribe [4]
  • #1 / Mar 30, 2011 3:02pm

    SunCSeeker

    15 posts

    I have the following content in {photos_link}:
        http://www.google.com

    When I include the following code in my template:

    {if photos_photo}
    
                            <h2>{photos_photo}</h2>
    <p>                        <div class="labs"><br />
                              </p><h2><a href="http://{photos_link}">{photos_caption}</a></h2>
    <p>                        </div><br />
                     {/if}

             
    The following html is returned by the server:

    <h2><a href="http://popeye.fmr.com:9080/ExpressionEngine/images/photo/icon_facebook.jpg">http://popeye.fmr.com:9080/ExpressionEngine/images/photo/icon_facebook.jpg</a></h2>
    <p>                        <div class="labs"><br />
                              </p><h2><a >http://www.google.com">Google</a></h2>
    
    <p>                        </div>

    But when I hover over the link on the page, I get the following:

    <a href="http://popeye.fmr.com:9080/ExpressionEngine/ee_fidelity/http://www.google.com">http://popeye.fmr.com:9080/ExpressionEngine/ee_fidelity/http://www.google.com</a>

    Why is http://popeye.fmr.com:9080/ExpressionEngine/ee_fidelity/ getting prepended to my content (URL)?


    By the by, the channel_auto_link_urls is ‘n’ for the “photos” channel.

  • #2 / Mar 31, 2011 5:53am

    Greg Salt

    3988 posts

    Hi SunCSeeker,

    What is the field formatting type of your photos_link field? Also, did you copy the ‘channel_auto_link_urls’ string from your channel preferences? Is that exactly what that field label is?

    Cheers

    Greg

  • #3 / Mar 31, 2011 6:39am

    Mark Bowen

    12637 posts

    I’m a bit confused as to exactly what the problem is here as you’ve said above that you have http://www.google.com in the {photos_link} variable but below that you show your ExpressionEngine code and the HTML output and to me it seems like what you are saying is that when you hover over the link you get that weird link showing?

    That’s not what you have showing in the HTML code output above. According to that it’s the {photos_photo} link which is at fault as can be seen in the HTML output.

    Are you sure you don’t perhaps have a problem with the {photos_photo} variable instead?

    Sorry if I’m missing the point and completely off on this one but that’s what it seems to be from reading the above. Just didn’t want you going on a wild goose chase looking at the {photos_link} variable and everything is correct and wondering what’s going on.

    Greg please do collapse (I know you would anyway 😉 ) this post if I’m totally wrong on this one but that’s what it seems like from looking at the code and HTML output given above.

    One last thing would be make sure you definitely have the http:// part in that field for the Google link because if you don’t have that then I believe ExpressionEngine will see a link as coming from the local server and does something much like what you’re experiencing here although I don’t think it usually places the http:// part back in again but maybe something to check.

    SunCSeeker please accept my apologies now if I’m totally misunderstanding all of this though. I definitely don’t want to step on anyones toes here.

    Best wishes,

    Mark

  • #4 / Mar 31, 2011 9:57am

    SunCSeeker

    15 posts

    The field type is: Text Input
    The value of the ‘channel_auto_link_urls’ string from the database is: n
    The Field Label is: Link
    The field name is: photos_link

    Default Text Formatting for This Field: None

    When I do a “View source” on the page I see the following html:

    <li>
      <h2><a href="http://popeye.fmr.com:9080/ExpressionEngine/images/photo/icon_facebook.jpg">http://popeye.fmr.com:9080/ExpressionEngine/images/photo/icon_facebook.jpg</a></h2>
    <p>  <div class="fidlabs"><br />
        </p><h2><aa href="http://www.google.com">Google</aa></h2>
    <p>  </div><br />
    </li>

    Please subsitite “<aa” with “<a” and “/aa>” with “/a>.


    I do not know, why the link is encased within “paragraph” tags.
    Also, when I hover over the link, and click on properties the Address value that is displayed is the following:

    <a href="http://popeye.fmr.com:9080/ExpressionEngine/ee_fidelity/http://www.google.com">http://popeye.fmr.com:9080/ExpressionEngine/ee_fidelity/http://www.google.com</a>

    So, needless to say, when I click on the link I get a HTTP 500 error.

  • #5 / Apr 03, 2011 4:59pm

    Greg Salt

    3988 posts

    Hi SunCSeeker,

    Is this on a publicly accessible site? Can you give us a link to see it? Please make sure that you do go back into the field formatting for the photos_link field and resave it with the formatting set to none just to make sure that is set correctly. What exactly is the content of the photos_link field in the example above? Did you type in just “http://google.com”? Which version of EE do you have installed?

    Cheers

    Greg

  • #6 / Apr 04, 2011 12:09pm

    SunCSeeker

    15 posts

    This is not a publicly accessible site; I cannot provide you give a link to see it.

    I did go back into the field formatting for the photos_link field and resaved it with the formatting set to none; it does not change a thing.

    The content of the photos_link field is http://www.google.com.

    The version of EE is: 2.1.3 Build 20101220

    Once again the problem is:

    The content of photos_link is: http://www.google.com
    But, when I hover over the link on the page it shows the link to be the following:

    <a href="http://popeye.fmr.com:9080/ExpressionEngine/ee_fidelity/http://www.google.com">http://popeye.fmr.com:9080/ExpressionEngine/ee_fidelity/http://www.google.com</a>.

    Two questions:

    Why is the link content getting enclosed inside  and  tags? and,
    Why is the site URL (<a href="http://popeye.fmr.com:9080/ExpressionEngine/ee_fidelity/">http://popeye.fmr.com:9080/ExpressionEngine/ee_fidelity/</a>) getting prepended to the contents of photos_link?
  • #7 / Apr 04, 2011 11:07pm

    Sue Crocker

    26054 posts

    SunCSeeker, there is a bug in that version of EE 2.1.3 that doesn’t set the value of the text field to None, it leaves it blank. So EE thinks it is an XHTML field.

    You need to manually change the value of the field to work with None.

    You go into the control panel and set the default formatting for the field in question to XHTML. When prompted, allow EE to update all the fields to XHTML, and then you go back to None, and once again let EE change the value of the field formatting to None. That should fix part of your problem.

    What exactly do you have in the actual url to the image?

  • #8 / Apr 05, 2011 9:39am

    SunCSeeker

    15 posts

    I did as you suggested and it is working fine now. Thanks a bunch for your help.

  • #9 / Apr 05, 2011 9:58am

    Sue Crocker

    26054 posts

    Glad that fixed the problem. Feel free to start a new thread if you have any more questions.

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

ExpressionEngine News!

#eecms, #events, #releases