Hyperlink in template file
Moderator: General Moderators
Hyperlink in template file
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.
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.
- AbraCadaver
- DevNet Master
- Posts: 2572
- Joined: Mon Feb 24, 2003 10:12 am
- Location: The Republic of Texas
- Contact:
Re: Hyperlink in template file
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.
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
- daedalus__
- DevNet Resident
- Posts: 1925
- Joined: Thu Feb 09, 2006 4:52 pm
Re: Hyperlink in template file
well, the short answer is no.
and so is the long answer.
css is only for styling html like languages
and so is the long answer.
css is only for styling html like languages
- AbraCadaver
- DevNet Master
- Posts: 2572
- Joined: Mon Feb 24, 2003 10:12 am
- Location: The Republic of Texas
- Contact:
Re: Hyperlink in template file
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.daedalus__ wrote:well, the short answer is no.
and so is the long answer.
css is only for styling html like languages
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Re: Hyperlink in template file
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.
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.
- AbraCadaver
- DevNet Master
- Posts: 2572
- Joined: Mon Feb 24, 2003 10:12 am
- Location: The Republic of Texas
- Contact:
Re: Hyperlink in template file
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';
?>mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
- daedalus__
- DevNet Resident
- Posts: 1925
- Joined: Thu Feb 09, 2006 4:52 pm
Re: Hyperlink in template file
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.
- AbraCadaver
- DevNet Master
- Posts: 2572
- Joined: Mon Feb 24, 2003 10:12 am
- Location: The Republic of Texas
- Contact:
Re: Hyperlink in template file
That's cool. If you have time, post an example.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.
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
- daedalus__
- DevNet Resident
- Posts: 1925
- Joined: Thu Feb 09, 2006 4:52 pm
Re: Hyperlink in template file
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
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
_____________________
affiliateelite ~ affiliateelite.com ~ adgooroo ~ adgooroo.com