LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-14-2016, 03:56 PM   #1
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
universal footer for html


sorry this is such an off the wall question, but for my senior design project part of it includes a simple web page for the project.

This is not required, but Id like to create some form of universal footer that i can edit one time and have it update for all pages in the site.

notary.brunkow.ws/ucf/tuba

is the URL. currently i have to edit the < footer > foo < /footer > on each page. Id like to have that section of each page be some kind of link.

I am an electrical engineer, not a computer programmer or a software guy.

Thanks in advance for the guidance and help.

FYI i do not have php nor do i have SSI enabled on the server, not am i able to add those features.
 
Old 04-14-2016, 07:34 PM   #2
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,317
Blog Entries: 28

Rep: Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140
If you are using css, this should be fairly easy to do. A web search for "css footer" will turn up a myriad of links.

Here's one: http://www.create-a-website-with-htm...tutorial6.html
 
Old 04-15-2016, 01:01 AM   #3
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
how did you make the site?
we must know this, because from the internet i can only see static html pages, but it is very well possible that they were created server side, most likely with php.

the footer content is in the html, not the css.
 
Old 04-15-2016, 05:11 AM   #4
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,475

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
If you're using apache then mod_sed may be what you need.

http://serverfault.com/a/768751
https://httpd.apache.org/docs/trunk/mod/mod_sed.html
 
Old 04-15-2016, 12:08 PM   #5
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983

Original Poster
Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
To answer the question as to how the site was made, look at the bottom of each page on the site. I used Bluegriffon to do the editing on the provided packaged template.

I attempted using the includes command from SSI, but failed.

Code:
]$ cat included.shtml
<footer> <a href="index.html">Home</a> | <a href="sponsors.html">Sponsors</a>
      | <a href="bios.html">Bios</a> | <a href="documents.html">Documents</a>
      | <a href="media.html">Media</a> | <br>
      Last updated April 13, 2016<br>
      website template by <a href="http://www.freehtml5templates.co.uk">Free
        HTML5 Templates</a> </footer>
then called it via:

Code:
<!--#include file="included.html" -->
that did nothing and failed to even produce the bottom box for the footer.
 
Old 04-19-2016, 01:05 AM   #6
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by lleb View Post
To answer the question as to how the site was made, look at the bottom of each page on the site. I used Bluegriffon to do the editing on the provided packaged template.
so it's just a bunch of individual html files.
first you have to remove the footer from all of them, and replace it with something else.
i assume you attempted something like that here:
Quote:
I attempted using the includes command from SSI, but failed.

Code:
]$ cat included.shtml
<footer> <a href="index.html">Home</a> | <a href="sponsors.html">Sponsors</a>
      | <a href="bios.html">Bios</a> | <a href="documents.html">Documents</a>
      | <a href="media.html">Media</a> | <br>
      Last updated April 13, 2016<br>
      website template by <a href="http://www.freehtml5templates.co.uk">Free
        HTML5 Templates</a> </footer>
then called it via:

Code:
<!--#include file="included.html" -->
that did nothing and failed to even produce the bottom box for the footer.
well, first of all, if the file is called included.shtml, then you have to also include
Code:
<!--#include file="included.shtml" -->
then, maybe also all the other original html files (index.html, contact.html and so on) have to be changed to end in .shtml?

i know nothing about SSI. i would use php.
wikipedia says that apache supports it, but maybe you have to switch it on in its config?
are you running an apache server?
 
1 members found this post helpful.
Old 04-19-2016, 08:48 AM   #7
HT-Borås
Member
 
Registered: Apr 2016
Location: Borås, Sweden
Distribution: CentOS
Posts: 54

Rep: Reputation: 18
Probably the footer can be made as a separate HTML file and then included in each page. W3Schools is an excellent website for everything web-related, and in this part they advocate a small JavaScript for the inclusion.
 
1 members found this post helpful.
Old 04-20-2016, 10:17 AM   #8
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983

Original Poster
Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
Thanks guys, Ill play with it this evening. Our presentation is this afternoon at 3pm EST so that is my current focus.
 
Old 04-22-2016, 12:56 PM   #9
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,306
Blog Entries: 3

Rep: Reputation: 3720Reputation: 3720Reputation: 3720Reputation: 3720Reputation: 3720Reputation: 3720Reputation: 3720Reputation: 3720Reputation: 3720Reputation: 3720Reputation: 3720
Be sure to read the official Apache documentation for Server-Side Includes (SSI). virtual= is used with a path relative to the URL

Code:
 <!--#include virtual="/included.html" -->
And file= is used relative to the filesystem

Code:
 <!--#include virtual="./included.html" -->
But they will only work if you have turned on "Options +Includes", or a variant, in the right Directory or Location directive and put "AddType text/html .shtml" in the right part of the configuration file. I'm not sure how CentOS/Fedora handles that, so it may be automatic, there may be a script, or you may have to add it by hand. It might be possible to do this in .htaccess if you are not sysadmin but it is not guaranteed that the prerequisites are there for you.

SSI is the way to go, IMHO, over JS or PHP. It is much less maintenance and, unlike JS, reaches everybody.

Last edited by Turbocapitalist; 04-22-2016 at 12:58 PM.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
html / css footer <div> won't behave esteeven Programming 2 08-02-2009 08:04 AM
Header, footer of a file lawrence_lee_lee Linux - Software 1 10-23-2007 07:26 AM
Attach an HTML Footer to eMails with Postifx . . . aratis Linux - Software 0 02-18-2006 10:29 AM
SMTP Footer aratis Programming 1 01-26-2006 08:26 AM
mta that can insert footer gigi Linux - Software 0 07-05-2005 12:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:02 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