Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
Digital Lifestyle
Web Design and Hosting
Converting html to javascript
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="kaidomac" data-source="post: 225052" data-attributes="member: 15110"><p>I think what you may be looking for is a PHP solution. I use PHP on a couple of my websites for handling templates. My <a href="http://www.wiredbynature.org" target="_blank">Wired by Nature</a> website uses a table-based layout. I created a template based on that table format, then broke it down into sections to wrap around the content. Each section chunk was put into an individual PHP file in a common directory on my server. This way, whenever I want to make a site-wide change, I only have to change my template files. For example, my header consists of a graphical logo and a list of links. I put the code in a file called header.php in a common directory and reference that file in each webpage like this:</p><p></p><p><span style="font-size: 9px"><?php include $_SERVER['DOCUMENT_ROOT'] . '/detox/header.php'; ?></span></p><p></p><p>The header.php file consists of this code:</p><p></p><p><span style="font-size: 9px"><tr></span></p><p><span style="font-size: 9px"><td align="center"></span></p><p><span style="font-size: 9px"></span></p><p><span style="font-size: 9px"><img src="http://www.wiredbynature.org/detox/header.jpg"></span></p><p><span style="font-size: 9px"><font size="2" face="Arial"></span></p><p><span style="font-size: 9px"><a href="http://www.wiredbynature.org/">Home</a> | </span></p><p><span style="font-size: 9px"><a href="http://www.wiredbynature.org/about.html">About</a> | </span></p><p><span style="font-size: 9px"><a href="http://www.wiredbynature.org/art/">Art</a> | </span></p><p><span style="font-size: 9px"><a href="http://www.wiredbynature.org/cars/">Cars</a> | </span></p><p><span style="font-size: 9px"><a href="http://www.wiredbynature.org/comp/">Computers</a> | </span></p><p><span style="font-size: 9px"><a href="http://www.wiredbynature.org/food/">Food</a> | </span></p><p><span style="font-size: 9px"><a href="http://www.wiredbynature.org/ht/">Home Theater</a> | </span></p><p><span style="font-size: 9px"><a href="http://www.wiredbynature.org/cpanel">Login</a> </span></p><p><span style="font-size: 9px"></font></span></p><p><span style="font-size: 9px"><br /></span></p><p><span style="font-size: 9px"><br /></span></p><p><span style="font-size: 9px"></td></span></p><p><span style="font-size: 9px"></tr></span></p><p></p><p>Rather than having to deal with all of that code, and the rest of the template code, in every page I make, I have just six lines to code to handle the template. I can easily toss up an article or other webpage using this template. Is this the kind of thing you're looking for?</p></blockquote><p></p>
[QUOTE="kaidomac, post: 225052, member: 15110"] I think what you may be looking for is a PHP solution. I use PHP on a couple of my websites for handling templates. My [URL=http://www.wiredbynature.org]Wired by Nature[/URL] website uses a table-based layout. I created a template based on that table format, then broke it down into sections to wrap around the content. Each section chunk was put into an individual PHP file in a common directory on my server. This way, whenever I want to make a site-wide change, I only have to change my template files. For example, my header consists of a graphical logo and a list of links. I put the code in a file called header.php in a common directory and reference that file in each webpage like this: [SIZE=1]<?php include $_SERVER['DOCUMENT_ROOT'] . '/detox/header.php'; ?>[/SIZE] The header.php file consists of this code: [SIZE=1]<tr> <td align="center"> <img src="http://www.wiredbynature.org/detox/header.jpg"> <font size="2" face="Arial"> <a href="http://www.wiredbynature.org/">Home</a> | <a href="http://www.wiredbynature.org/about.html">About</a> | <a href="http://www.wiredbynature.org/art/">Art</a> | <a href="http://www.wiredbynature.org/cars/">Cars</a> | <a href="http://www.wiredbynature.org/comp/">Computers</a> | <a href="http://www.wiredbynature.org/food/">Food</a> | <a href="http://www.wiredbynature.org/ht/">Home Theater</a> | <a href="http://www.wiredbynature.org/cpanel">Login</a> </font> <br /> <br /> </td> </tr>[/SIZE] Rather than having to deal with all of that code, and the rest of the template code, in every page I make, I have just six lines to code to handle the template. I can easily toss up an article or other webpage using this template. Is this the kind of thing you're looking for? [/QUOTE]
Verification
Post reply
Forums
Digital Lifestyle
Web Design and Hosting
Converting html to javascript
Top