Page 1 of 1
Hyperlink in template file
Posted: Fri Dec 18, 2009 6:14 pm
by raydona
Hi,
I wish to create about 200 web pages (html) files. Each file will have a hyperlink (<a href="http://......) to another site. Normally you would place the hyperlink in the html file. But if I had to change the address to a different site I do not fancy going through each and every file changing the hyperlink. Is there any way I can place the hyperlink in a CSS file so that if the
address changes I would have to just alter it once in the template CSS file and it would alter the address in all the html files. All help will be greatly appreciated.
Re: Hyperlink in template file
Posted: Fri Dec 18, 2009 6:18 pm
by AbraCadaver
Not sure about CSS. I use it frequently but I'm not a guru of all that it can do. What I can tell you is this is easy as pie with PHP.
Re: Hyperlink in template file
Posted: Fri Dec 18, 2009 6:31 pm
by daedalus__
well, the short answer is no.
and so is the long answer.
css is only for styling html like languages
Re: Hyperlink in template file
Posted: Fri Dec 18, 2009 6:50 pm
by AbraCadaver
daedalus__ wrote:well, the short answer is no.
and so is the long answer.
css is only for styling html like languages
That was my gut feel. I know that you can specify the url of background images etc. in CSS, but wasn't sure if the same could be done for the href of a link. I thought no, but still someone could pop-up with an awesome example of how to do it.
Re: Hyperlink in template file
Posted: Sun Dec 20, 2009 1:12 pm
by raydona
Hi,
Many thanks for the replies. The only bit of php I know is connecting to a database. Would it be possible to give me the actual code or point me in the right direction as to what I should actually do.
Re: Hyperlink in template file
Posted: Sun Dec 20, 2009 3:39 pm
by AbraCadaver
Simple example.
Code: Select all
// example of your files (probably needs .php extension)
<?php include('config.php'); ?>
<a href="<?php echo $url; ?>">Link Text</a>
Code: Select all
// config.php
<?php
$url = 'http://www.example.com';
?>
Re: Hyperlink in template file
Posted: Mon Dec 21, 2009 8:27 pm
by daedalus__
hey you aren't going to believe this but using the :before or :after pseudo-selectors and the content: attribute he could place the links in his css file.

i haven't checked up on browser support though cause i was reading the spec.
Re: Hyperlink in template file
Posted: Tue Dec 22, 2009 8:29 am
by AbraCadaver
daedalus__ wrote:hey you aren't going to believe this but using the :before or :after pseudo-selectors and the content: attribute he could place the links in his css file.

i haven't checked up on browser support though cause i was reading the spec.
That's cool. If you have time, post an example.
Re: Hyperlink in template file
Posted: Wed Dec 23, 2009 3:25 pm
by daedalus__
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Conforming XHTML 1.1 Template</title>
<style type="text/css">p.note:before { content: "Note: " }</style>
</head>
<body>
<h1>Example of Generated Content using CSS</h1>
<p class="note">I don't really think it should be called generated content.</p>
</body>
</html>
Re: Hyperlink in template file
Posted: Tue Jun 15, 2010 4:43 am
by kracey
Is it possible to create hyperlink from a web site to a specific section within a PDF document? For instance: I have a 125 page document, with 15 sections. I would like to create a hyperlink from a web page directly to section 9 within the PDF. When the PDF opens, I would have the entire PDF there to view, but it would open to section 9 automatically? Is this possible?
_____________________
affiliateelite ~
affiliateelite.com ~
adgooroo ~
adgooroo.com