HighDots Forums  

assign an url to a tag

alt.html alt.html


Discuss assign an url to a tag in the alt.html forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Jan Faerber
 
Posts: n/a

Default assign an url to a tag - 11-01-2004 , 09:47 AM






Can you assign an url to a tag?
E.g. you have a table with some rows
and in each row a link.
And if you want to change the url
you only have to change the id.

I give here an url:
http://www.janfaerber.com/alt.html/assign-url2tag.php



--
Jan

http://www.janfaerber.com

Reply With Quote
  #2  
Old   
nice.guy.nige
 
Posts: n/a

Default Re: assign an url to a tag - 11-01-2004 , 01:45 PM






While the city slept, Jan Faerber (faerber73 (AT) yahoo (DOT) com) feverishly typed...

Quote:
Can you assign an url to a tag?
E.g. you have a table with some rows
and in each row a link.
And if you want to change the url
you only have to change the id.

I give here an url:
http://www.janfaerber.com/alt.html/assign-url2tag.php
It sounds like you are wanting to use CSS for this. CSS is for presentation,
not content.

As it appears you have php-enabled webspace, then why not try a php
approach? Something like the following;

<?php
$link1 = "http://www.microsoft.com";
$link2 = "http://www.google.com";
$link3 = "http://www.ebay.co.uk";
?>

<table>
<tr><td><a href="<?=$link1 ?>"><?=$link1 ?></a></td></tr>
<tr><td><a href="<?=$link2 ?>"><?=$link2 ?></a></td></tr>
<tr><td><a href="<?=$link3 ?>"><?=$link3 ?></a></td></tr>
</table>

.... Note: This is straight off the top of my head, and hasn't been tested.

You can also store the links in a separate php include file, then include it
into each file where you need it. Then you will only need to change links in
the include file.

Hope that helps.

Cheers,
Nige

--
Nigel Moss
http://www.nigenet.org.uk
Mail address not valid. nigel (AT) DOG (DOT) nigenet.org.uk, take the DOG. out!
In the land of the blind, the one-eyed man is very, very busy!




Reply With Quote
  #3  
Old   
Karl Core
 
Posts: n/a

Default Re: assign an url to a tag - 11-01-2004 , 02:46 PM




"nice.guy.nige" <nigel_moss (AT) deadspam (DOT) com> wrote

Quote:
While the city slept, Jan Faerber (faerber73 (AT) yahoo (DOT) com) feverishly
typed...

Can you assign an url to a tag?
E.g. you have a table with some rows
and in each row a link.
And if you want to change the url
you only have to change the id.

I give here an url:
http://www.janfaerber.com/alt.html/assign-url2tag.php

It sounds like you are wanting to use CSS for this. CSS is for
presentation,
not content.

As it appears you have php-enabled webspace, then why not try a php
approach? Something like the following;

?php
$link1 = "http://www.microsoft.com";
$link2 = "http://www.google.com";
$link3 = "http://www.ebay.co.uk";
?

table
tr><td><a href="<?=$link1 ?>"><?=$link1 ?></a></td></tr
tr><td><a href="<?=$link2 ?>"><?=$link2 ?></a></td></tr
tr><td><a href="<?=$link3 ?>"><?=$link3 ?></a></td></tr
/table

... Note: This is straight off the top of my head, and hasn't been tested.

You can also store the links in a separate php include file, then include
it
into each file where you need it. Then you will only need to change links
in
the include file.

Personally, I'd go with an array, then loop through the array to display it,
rather than hard code all this crap:
"<tr><td><a href="<?=$link3 ?>"><?=$link3 ?></a></td></tr>"


-Karl




Reply With Quote
  #4  
Old   
Jan Faerber
 
Posts: n/a

Default Re: assign an url to a tag - 11-02-2004 , 05:35 AM



nice.guy.nige wrote:

Quote:
?php
$link1 = "http://www.microsoft.com";
$link2 = "http://www.google.com";
$link3 = "http://www.ebay.co.uk";
?

table
tr><td><a href="<?=$link1 ?>"><?=$link1 ?></a></td></tr
tr><td><a href="<?=$link2 ?>"><?=$link2 ?></a></td></tr
tr><td><a href="<?=$link3 ?>"><?=$link3 ?></a></td></tr
/table
thank you - good idea



--
Jan

http://www.janfaerber.com


Reply With Quote
  #5  
Old   
Mitja
 
Posts: n/a

Default Re: assign an url to a tag - 11-02-2004 , 12:55 PM



On Mon, 01 Nov 2004 14:47:09 GMT, Jan Faerber <faerber73 (AT) yahoo (DOT) com> wrote:

Quote:
Can you assign an url to a tag?
And if you want to change the url
you only have to change the id.
Via an external file? Only with javascript
CSS is out, it does not and probably never will support this, because it has nothing to do with presentation.
What remains is a database (either a real one or a plain-text file) that is consulted by a server-side script each each time the page is requested in order to insert urls into tags with appropriate ids.

--
Mitja


Reply With Quote
  #6  
Old   
Robert Frost-Bridges
 
Posts: n/a

Default Re: assign an url to a tag - 11-02-2004 , 04:25 PM



Mitja wrote:

[...]
Quote:
CSS is out, it does not and probably never will support this, because
it has nothing to do with presentation.
[...]

I'm sure you meant to say it has everything to do with presentation. :-)

--
frostie
http://brightonfixedodds.net


Reply With Quote
  #7  
Old   
Neal
 
Posts: n/a

Default Re: assign an url to a tag - 11-02-2004 , 04:49 PM



Robert Frost-Bridges wrote:
Quote:
Mitja wrote:
CSS is out, it does not and probably never will support this, because
it has nothing to do with presentation.
I'm sure you meant to say it has everything to do with presentation. :-)
What the OP wanted had nothing to do with presentation. Of course, CSS has
everything to to with presentation.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.