LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-01-2012, 01:59 AM   #1
gozlemci
Member
 
Registered: Mar 2010
Location: Turkey
Posts: 35

Rep: Reputation: 0
[HTML] Defining constant elements in different pages


Hi There;
I try to design a web site. There are many pages in my web site and I linked them altogether. But there are constant buttons must be existed in different pages. I mean there are buttons namely, "Home" , "About" .. vs in different HTML pages . I do not write to codes of constant buttons in every HTML pages. How can I handle this?

Thanks in advance.
 
Old 02-01-2012, 08:58 AM   #2
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
It is hard to understand what you are asking, but I will try to read between the lines. I presume that you are creating some code that generates the HTML that makes your web site, and you don't want every code module to be required to generate some standard set of HTML entities. If such is the case, then one solution would be to use a template, or small number of templates, which already contain the standard collection of HTML, and to which your code adds specific other HTML code. As I understand it, this a common strategy used by web framework packages such as Ruby-On-Rails and Django.
--- rod.
 
Old 02-01-2012, 08:51 PM   #3
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,225

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
It's already been said, but:

Use a backend with some sort of templating engine.

Or a content management system like Wordpress (if appropriate). If your website isn't actually an application, then Wordpress is probably appropriate.

Last edited by dugan; 02-01-2012 at 09:49 PM.
 
Old 02-02-2012, 12:52 AM   #4
AnanthaP
Member
 
Registered: Jul 2004
Location: Chennai, India
Posts: 952

Rep: Reputation: 217Reputation: 217Reputation: 217
Use include files.

Even for simple HTML pages, if javascript is enabled, you can use include files thus.

In every calling program,
Quote:
<script language="javascript" src="MY_COMMON_FUNCTIONS.js">
and MY_COMMON_FUNCTIONS.js contains
document.write ("Hello world<br>") ;
and so on.
to write commonly used HTML code.
 
  


Reply



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

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



Similar Threads
Thread Thread Starter Forum Replies Last Post
MS Publisher html pages for new web pages do not open in firefox, any suggestions?? Bwebman Linux - Newbie 3 06-13-2009 10:35 AM
LXer: Finaly we get new elements in HTML 5 LXer Syndicated Linux News 0 08-09-2007 04:16 PM
html form - order of returned elements rblampain Programming 2 04-26-2007 07:13 AM
defining an array in html template to be used by php mohtasham1983 Programming 2 01-28-2006 04:23 PM
Cookie Sharing Between CGI generated HTML pages and standard HTML pages rkwhited Linux - Newbie 5 08-15-2004 07:39 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:27 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration