View previous topic - View next topic |
Author |
Message |
XMark Guitar playin' black mage
Joined: 30 May 2002 Posts: 870 Location: New Westminster, BC, Canada
|
Posted: Sat Sep 27, 2003 8:32 pm Post subject: web design question |
[quote] |
|
is it possible to have it so a bunch of different pages share the same HTML code for part of it (say, a sidebar menu) without re-writing the code for each page? (I don't want to use frames) _________________ Mark Hall
Abstract Productions
I PLAYS THE MUSIC THAT MAKES THE PEOPLES FALL DOWN!
|
|
Back to top |
|
|
LeoDraco Demon Hunter
Joined: 24 Jun 2003 Posts: 584 Location: Riverside, South Cali
|
Posted: Sat Sep 27, 2003 9:25 pm Post subject: |
[quote] |
|
Use a web-tech: anything from a server-sided scripting language (such as ASP, Perl, PHP, ColdFushion, etc.) should be able to link source into a template file. A Python script could be used to do the same, although this isn't necessarily as dynamic as the others.
My personal favorite would be PHP: it's free and open source; it's easy to use; it isn't proprietary; many servers today offer PHP support; it can do practically anything that Perl or Python can do; it's a C-syntax language, so picking it up is really simple; it can be either Object-Oriented or procedural (so it wraps rather nicely about your own coding style); it's untyped, and provides a series of data structures (like (associative) arrays) to store things, so usage is minimalistic. It's good stuff. _________________ "...LeoDraco is a pompus git..." -- Mandrake
|
|
Back to top |
|
|
Rainer Deyke Demon Hunter
Joined: 05 Jun 2002 Posts: 672
|
Posted: Sat Sep 27, 2003 10:41 pm Post subject: |
[quote] |
|
I second that recommendation. As a programming language, PHP is an abomination, but as a tool for dynamic web pages, it's pretty slick. Just don't try to do anything too complicated with it.
|
|
Back to top |
|
|
LeoDraco Demon Hunter
Joined: 24 Jun 2003 Posts: 584 Location: Riverside, South Cali
|
Posted: Sat Sep 27, 2003 10:49 pm Post subject: |
[quote] |
|
Rainer Deyke wrote: | Just don't try to do anything too complicated with it. |
Such as? This fora system, while not excellent, is a rather complicated piece of software, and it's written in PHP. _________________ "...LeoDraco is a pompus git..." -- Mandrake
|
|
Back to top |
|
|
Ninkazu Demon Hunter
Joined: 08 Aug 2002 Posts: 945 Location: Location:
|
Posted: Sat Sep 27, 2003 10:52 pm Post subject: |
[quote] |
|
I used to just import a Javascript file into each page that had:
Code: |
function w(t){
document.write(t);
}
w('All the stuff to be printed');
|
But of COURSE, Netscape didn't work so well with it. God DAMN IT I hate Netscape.
|
|
Back to top |
|
|
Bjorn Demon Hunter
Joined: 29 May 2002 Posts: 1425 Location: Germany
|
Posted: Sat Sep 27, 2003 11:17 pm Post subject: |
[quote] |
|
If you can import a JavaScript, why not just generate the neccesary HTML? Oh well, guess that wasn't an option. When I didn't know PHP, I made this website. It's menu, sidebar and search engine are totally JavaScript generated. And of course, it's using frames... and it's not looking good in Mozilla because some of the borders depend on pixel-perfect positioning which was tuned for IE. It makes me shiver these days, and have even been thinking about offering a rewrite in a server-side scripting language, without frames and cross-browser compatible.
As for XMark's question, it can't be done without as least a little editing on each page. I suggest PHP too, as it's available on xmark.rpgdx.net and because it allows the insertion of the menu with only a single line:
Code: | <html>
<head><title>My Title</title></head>
<body>
<h1>My title</h1>
<p>My contents</p>
</body>
</html> |
Code: | <html>
<head><title>My Title</title></head>
<body>
<?php include("my_menu.html"); ?>
<h1>My title</h1>
<p>My contents</p>
</body>
</html> |
You can use CSS to position it anywhere on the site, like as a sidebar or at the top. A static sidebar, that stays at one place while scrolling, is also possible using absolute positioning.
Of course, you need to change the extension of the pages from html to php to have the <?php ?> sequences executed.
|
|
Back to top |
|
|
Rainer Deyke Demon Hunter
Joined: 05 Jun 2002 Posts: 672
|
Posted: Sun Sep 28, 2003 12:57 am Post subject: |
[quote] |
|
LeoDraco wrote: | Such as? This fora system, while not excellent, is a rather complicated piece of software, and it's written in PHP. |
Such as anything that makes you wish you had a real programming language. I understand why this message board system was written in PHP - PHP is widely available and is not Perl - but anybody who attempts a project like that is in for a lot of pain.
|
|
Back to top |
|
|
Rainer Deyke Demon Hunter
Joined: 05 Jun 2002 Posts: 672
|
Posted: Sun Sep 28, 2003 1:02 am Post subject: |
[quote] |
|
Bjørn wrote: | You can use CSS to position it anywhere on the site, like as a sidebar or at the top. A static sidebar, that stays at one place while scrolling, is also possible using absolute positioning. |
I've had some bad experiences with using CSS for positioning - sidebars overlapping the main page and similar. That's why I use tables for positioning on my page.
|
|
Back to top |
|
|
LeoDraco Demon Hunter
Joined: 24 Jun 2003 Posts: 584 Location: Riverside, South Cali
|
Posted: Sun Sep 28, 2003 1:23 am Post subject: |
[quote] |
|
Rainer Deyke wrote: | Such as anything that makes you wish you had a real programming language. I understand why this message board system was written in PHP - PHP is widely available and is not Perl - but anybody who attempts a project like that is in for a lot of pain. |
That's your opinion; it isn't established fact. You can do extremely complex things in PHP, with little to no hassle whatsoever. Stop being 1337.
Quote: | I've had some bad experiences with using CSS for positioning - sidebars overlapping the main page and similar. That's why I use tables for positioning on my page. |
CSS, and CSS support, has improved considerably over the past year, or so. Being careful with what you are doing, and validating what you are doing are important parts of design. _________________ "...LeoDraco is a pompus git..." -- Mandrake
|
|
Back to top |
|
|
Rainer Deyke Demon Hunter
Joined: 05 Jun 2002 Posts: 672
|
Posted: Sun Sep 28, 2003 1:51 am Post subject: |
[quote] |
|
LeoDraco wrote: | That's your opinion; it isn't established fact. You can do extremely complex things in PHP, with little to no hassle whatsoever. Stop being 1337. |
I'm not being "1337". On the contrary, I'm saying the messiness of PHP is too much for me, personally, to deal with on large projects. By the same token, I can't write more than one page or so of (optimized) assembly code before I give up and go back to another language. If you can do it, more power to you.
|
|
Back to top |
|
|
Chingwa I wanna be a ballerina!
Joined: 25 Sep 2003 Posts: 26
|
Posted: Sun Sep 28, 2003 1:52 am Post subject: |
[quote] |
|
Mivascript is very similar to the others mentioned, and integrates much easier into the html code as the syntax is very basic. Is extremely easy to pick up if you already know html. The only downside is not many servers offer miva support by default... and it doesn't seem very widely known, compared to the "biggies". But with a bit of work you can do interesting things with it. I wrote a whole guestbook program in mivascript...
|
|
Back to top |
|
|
LeoDraco Demon Hunter
Joined: 24 Jun 2003 Posts: 584 Location: Riverside, South Cali
|
Posted: Sun Sep 28, 2003 2:04 am Post subject: |
[quote] |
|
Rainer Deyke wrote: | I'm not being "1337". On the contrary, I'm saying the messiness of PHP is too much for me, personally, to deal with on large projects. By the same token, I can't write more than one page or so of (optimized) assembly code before I give up and go back to another language. If you can do it, more power to you. |
And I'm saying that you are unfairly catagorizing the language as useless for large projects, simply because you don't care for it. Writing large projects in PHP isn't difficult to do. In your original message, you implied that PHP wasn't good for large scale projects; you also implied that it wasn't a very good language. All of these things are bigoted opinions. Which are most often found around people who are attempting to be 1337. _________________ "...LeoDraco is a pompus git..." -- Mandrake
Last edited by LeoDraco on Sun Sep 28, 2003 3:08 am; edited 1 time in total
|
|
Back to top |
|
|
Happy JonA's American snack pack
Joined: 03 Aug 2002 Posts: 200
|
Posted: Sun Sep 28, 2003 3:03 am Post subject: |
[quote] |
|
LeoDraco wrote: | And I'm saying that you are unfairly catagorizing the language as useless for large projects, simply because you don't care for it. Writing large projects in PHP isn't difficult to do. In your original message, you implied that PHP wasn't good for large scale projects; you also implied that it wasn't a very good language. All of these things are bigoted opinions. Which are most often found around people who are attempting to be 1337. |
I totally agree with you Leo.
Rainer Deyke; you shouldn't say something like "As a programming language, PHP is an abomination, but as a tool for dynamic web pages, it's pretty slick." without saying that it's your opinion. Also, of course PHP is an abomination as a programming language. It's a scripting language.
Rainer Deyke wrote: | Such as anything that makes you wish you had a real programming language. I understand why this message board system was written in PHP - PHP is widely available and is not Perl - but anybody who attempts a project like that is in for a lot of pain. |
Again, PHP is a scripting language. It's primarily used as a hypertext preprocessor.
Rainer Deyke wrote: | I'm not being "1337". On the contrary, I'm saying the messiness of PHP is too much for me, personally, to deal with on large projects. By the same token, I can't write more than one page or so of (optimized) assembly code before I give up and go back to another language. If you can do it, more power to you. |
If PHP is messy, then I don't know what's clean. BASIC perhaps? By the same token, maybe you make better analogies. PHP is a scripting language and it's syntax is nowhere near the low-levelness of assembly code.
Rainer Deyke wrote: | I've had some bad experiences with using CSS for positioning - sidebars overlapping the main page and similar. That's why I use tables for positioning on my page. |
Heh. Maybe you should RTFM.
Rainer Deyke wrote: | Just don't try to do anything too complicated with it. |
MWAHAHAHAHAHAHAHAHA
*Ahem* Sorry for the acronym use. Besides language names, I try to refrain from using them.
Also, XMark: Three words. CSS. DOM. PHP. (And XHTML. And XML.)
|
|
Back to top |
|
|
BigManJones Scholar
Joined: 22 Mar 2003 Posts: 196
|
Posted: Sun Sep 28, 2003 4:46 am Post subject: |
[quote] |
|
Quote: | you shouldn't say something like "As a programming language, PHP is an abomination, but as a tool for dynamic web pages, it's pretty slick." without saying that it's your opinion. |
Silly me, I assumed it WAS his opinion.
For that matter, you can use LUA for scripting web pages too, but no one has mentioned it. I personally, and this is my opinion, despise any language were all variables are global by default. But thats just my opinion.
|
|
Back to top |
|
|
LeoDraco Demon Hunter
Joined: 24 Jun 2003 Posts: 584 Location: Riverside, South Cali
|
Posted: Sun Sep 28, 2003 6:30 am Post subject: |
[quote] |
|
BigManJones wrote: | I personally, and this is my opinion, despise any language were all variables are global by default. But thats just my opinion. |
And which language would this be? _________________ "...LeoDraco is a pompus git..." -- Mandrake
|
|
Back to top |
|
|
|
Page 1 of 2 |
All times are GMT Goto page 1, 2 Next
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|