Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2006-09-16 15:06:51
- FireFusion
- Member

- Registered: 2005-05-10
- Posts: 698
Internal and External links a problem
I want to use the following CSS 2.1 feature to add an image to all extenal links.
<code>a[href^=“http:”] {
background: url(img/externalLink.gif) no-repeat right top;
padding-right: 10px;
}</code>
The trouble is all my internal navigation is generated by textpattern, so all links come out as http://mysite.com/section/title. Is there any way to make them just section/title?
Last edited by FireFusion (2006-09-16 15:07:11)
Offline
Re: Internal and External links a problem
I never used this method, but wouldn’t it be possible to define
a[href^="http://yoursite.com/"] {
background: none;
}
for your internal links?
Offline
#3 2006-09-17 07:42:56
- FireFusion
- Member

- Registered: 2005-05-10
- Posts: 698
Re: Internal and External links a problem
Of course! That worked great. Thanks.
Why does TXP do internal URLs like that though?
Offline
#4 2006-09-18 00:37:17
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: Internal and External links a problem
Because some people might install Textpattern in a subdirectory, etc. That means trying to fool around to figure out how to build a relative url. It’s just far simpler to output an absolute one, which works for everyone.
Offline
#5 2006-09-18 07:25:24
- FireFusion
- Member

- Registered: 2005-05-10
- Posts: 698
Re: Internal and External links a problem
Ah I see. Thanks.
Offline
Pages: 1