CodeIgniter Forums
url anchor producing strange output - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: url anchor producing strange output (/showthread.php?tid=21514)



url anchor producing strange output - El Forum - 08-12-2009

[eluser]boony[/eluser]
Hello

Just encountered very strange thing. I am doing a standard nav bar and have an anchor code like:
Code:
<?=anchor('welcome/index', 'home')?>

Seems straight forward. But the view is producing this...
Code:
home (http://localhost/bluewhale/index.php/welcome/index.html)
You can see that the link is ok but the actual url is also displayed.

This is happening for all links. But not on another test site on the same localhost server. What is going on???


url anchor producing strange output - El Forum - 08-12-2009

[eluser]wabu[/eluser]
Are your 'base_url' and 'index_page' config settings different for your test site?


url anchor producing strange output - El Forum - 08-12-2009

[eluser]boony[/eluser]
[quote author="wabu" date="1250096067"]Are your 'base_url' and 'index_page' config settings different for your test site?[/quote]

Well, this is very strange. :bug: I think I have all the appropriate settings:

correct base url
loaded the url helper
routes ok
correct syntax

basically, the same page works in another subdirectory.

Any other thoughts anyone?


url anchor producing strange output - El Forum - 08-12-2009

[eluser]garymardell[/eluser]
Style sheet maybe.
For some reason you may have something like this:

a:link:after, a:visited:after {content:" (" attr(href) ")"}

In your stylesheet, i know it comes part of the blueprint css framework in the print.css file. This would make what you are viewing. As it gets the url and appends it after the link in brackets.


url anchor producing strange output - El Forum - 08-12-2009

[eluser]boony[/eluser]
[quote author="garymardell" date="1250099418"]Style sheet maybe.
For some reason you may have something like this:

a:link:after, a:visited:after {content:" (" attr(href) ")"}

In your stylesheet, i know it comes part of the blueprint css framework in the print.css file. This would make what you are viewing. As it gets the url and appends it after the link in brackets.[/quote]

Ho ho, this is interesting. I haven't yet gone to check but yes, I am using the blueprint css framework, however funny enough I am using the exact same css files in both sites on the localhost (subdirectories) but the problem only appears in one. In fact most of the site is a direct copy of the older one and this has come up as a problem in the new test site.

This is truly weird...


url anchor producing strange output - El Forum - 08-12-2009

[eluser]garymardell[/eluser]
Somewhere down the line the print.css stylesheet may not be loaded as the print stylesheet but also as a media one which would explain the links. Try removing that line from the stylesheets.


url anchor producing strange output - El Forum - 08-12-2009

[eluser]boony[/eluser]
Whoa there, hold ya horses....Yep that was the sucker! I checked both and realise that I has placed the print.css file in the header of the new test site (don't really know why exactly) but I got rid of it and the damn links work perfectly well..just wish my brain would do the same... %-P


url anchor producing strange output - El Forum - 08-12-2009

[eluser]garymardell[/eluser]
Lol, well glad that i could help. You should be amazed by my ability to pick out the problem from no where. Not knowing you were using blueprint or anything :p


url anchor producing strange output - El Forum - 08-12-2009

[eluser]boony[/eluser]
Thanks Gary,

you are a genius! But this is what makes this forum the absolute best I have ever used. Amazing people who are prepared to give back to the community in some of the fastest turn around you can only dream of elsewhere. :-)


url anchor producing strange output - El Forum - 08-12-2009

[eluser]garymardell[/eluser]
This forum is pretty amazing for support, i think there must be some of the fastest response times to problems. There are some truly clever people on here and great programmers.