Skip to content
View in the app

A better way to browse. Learn more.

Tip.It Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

I need your help, all ye people who know interwebs design!

Featured Replies

My website has a side bar that's on almost every page. It contains links to navigate the site and stuff.

Every time I edit this side bar I have to go through and add the changes to very single page, which is annoying, and takes a long time.

 

Does anyone know how I can make it so that if I edit the side bar on one page, it will have the same changes on every other page?

 

Do I need to use PHP for this, or does it work with HTML, or XTML? Is it a script? I don't know anything about javascript or PHP, but I do know how to copy, and paste code. :P

 

 

Like lets say I have this as a side bar:

<!--SIDE BAR START-->
<tr>
<td valign="top" bgcolor="silver">
<font size="5"><strong>Text</strong></font>
<br/><hr>
<font size="4"><strong>Text</strong></font>
<font size="2">
<br/><br/>
Text <br/><a href="URL">Link text</a>
<br/><br/>
</font>
<img src="./pics/spacer.gif" width="1" height="100%">
</td>
<!--SIDE BAR END-->

 

If I want to change it, like by adding a link, or fixing a spelling error etc, but not have to go and edit each page manually to add the changes.

Prism_Swords.png

Its easy in php as you can just use require() or include().

If you don't have php its possible using javascript, but that would lead to anyone with javascript disabled unable to use the navigation.

 

Anyway this is the php way of doing it.

Main page

<html>
<head></head>
<body>
<!--SIDE BAR START-->
  <?php
     include('nav.htm');
  ?>
<!--SIDE BAR END-->
</body>
</html>

Navigation page

<table>
<tr>
<td valign="top" bgcolor="silver">
<font size="5"><strong>Text</strong></font>
<br/><hr>
<font size="4"><strong>Text</strong></font>
<font size="2">
<br/><br/>
Text <br/><a href="URL">Link text</a>
<br/><br/>
</font>
<img src="./pics/spacer.gif" width="1" height="100%">
</td>
</table>

 

I would highly advise you don't use tables in that way though as CSS is a lot better and will allow for much easier coding in the long term.

[hide=Drops]

  • Dragon Axe x11
    Berserker Ring x9
    Warrior Ring x8
    Seercull
    Dragon Med
    Dragon Boots x4 - all less then 30 kc
    Godsword Shard (bandos)
    Granite Maul x 3

Solo only - doesn't include barrows[/hide][hide=Stats]

joe_da_studd.png[/hide]

Yeah use php like Joe said. Also seconding the non-use of tables, they should only be used for actual tables -- using them for layouts is messy as hell. Use div's (css) instead.

  • Author

Yeah, I'm not to good with CSS's. I need to read up on them some more.

 

Thanks a lot for the help though. :)

 

*edit*

It's not loading the "nav.htm". I have already checked and made sure that it's not a typo or something like a capital letter.

 

I'm thinking something is wrong, because when I click "viewscource" in Firefox what i see is:

<!--SIDE BAR START-->
<?php include("nav.htm"); ?>
<!--SIDE BAR END-->

Which I know is not right, because your not even supposed to be able to see php code when you view the source.

I have even googled your example code, and found a couple of tutorials. I have copy/pasted all the code from those tutorials, and still it won't work.

 

Do I have to compile php or something?

Prism_Swords.png

Show a screenie of the site and we could help you a little more.

2257AD.TUMBLR.COM

Why not simply use an external css file instead? Or maybe I'm misunderstanding something here.

  • Author

Why not simply use an external css file instead? Or maybe I'm misunderstanding something here.

CSS's can't add new lines (text, links, images, etc) to the page, can it? I thought it could only modify (color, size, etc) what was already there.

 

*edit*

Not even the

<?php
echo "Text";
?>

is working, do I have to download a PHP plugin?

Prism_Swords.png

You need to actually save it as .php not .html.

 

I suggest you read up on some basic tutorials on php. Sure, you could just "copy/paste" but that isn't exactly going to help you in the long run, now is it? We can't hold your hand that much, some of the stuff you'll have to figure out on your own.

Why not simply use an external css file instead? Or maybe I'm misunderstanding something here.

CSS's can't add new lines (text, links, images, etc) to the page, can it? I thought it could only modify (color, size, etc) what was already there.

 

*edit*

Not even the

<?php
echo "Text";
?>

is working, do I have to download a PHP plugin?

I didn't see you wanted to do that, sorry, didn't quite read what was in the code quotes.

  • Author

I have figured it out. I have to down load a plug-in for php to work, but there is no point in me doing that.

Also php code is not working online for me, because my web host (freewebs aka webs.com) does not support php unless your a paying member. :(

 

@sbrideau2000: I was just showing that even the most basic of hp was not working for me.

Prism_Swords.png

I have figured it out. I have to down load a plug-in for php to work, but there is no point in me doing that.

Also php code is not working online for me, because my web host (freewebs aka webs.com) does not support php unless your a paying member. :(

 

@sbrideau2000: I was just showing that even the most basic of hp was not working for me.

 

I'm guessing by plug-in you're probably talking about a CMS like wordpress, right? They generally use PHP for the layout so it is easy to dynamically edit them.

If you're just going to have static content and your server it running Apache or lighthttpd you could use SSI(Server Side Includes). Provided your host supports it and with free hosting beggars can't be choosers. With PHP your going to need PHP installed along with some type of web server such as Apache, lighthttpd, IIS, etc. You could do it all on the client side via JavaScript without any server requirements; unfortunately, that means you will need to make sure your user's browser supports JavaScript. Most browsers support JavaScript, however, there are a few that don't such as mobile phones.

  • Author

If you're just going to have static content and your server it running Apache or lighthttpd you could use SSI(Server Side Includes). Provided your host supports it and with free hosting beggars can't be choosers. With PHP your going to need PHP installed along with some type of web server such as Apache, lighthttpd, IIS, etc. You could do it all on the client side via JavaScript without any server requirements; unfortunately, that means you will need to make sure your user's browser supports JavaScript. Most browsers support JavaScript, however, there are a few that don't such as mobile phones.

Plus the fact people disable scripts for security.

Prism_Swords.png

I've been wondering this for ages! I could have sworn I did SOMETHING for this...

Chris2fer381.png

PHP is not a plugin, it is a preprocessor that runs on webservers. Freewebs is absolutely terrible when it comes to features, as I've found.

C2b6gs7.png

It's possible to do this without any PHP/CSS at all:

<!--#include file="navbar.html" -->

 

However, for this to work, you must save every single page you use this on as shtml. That basically means changing the extension from html to shtml. Pretty easy.

 

Your navbar code should work with this without any problems.

 

By the way, if you want a good free host, I suggest this one. Much better than Webs.

  • Author

It's possible to do this without any PHP/CSS at all:

<!--#include file="navbar.html" -->

 

However, for this to work, you must save every single page you use this on as shtml. That basically means changing the extension from html to shtml. Pretty easy.

 

Your navbar code should work with this without any problems.

Wait, isn't

<!--text-->

code for a commenting things out?

 

By the way, if you want a good free host, I suggest this one. Much better than Webs.

Looks to good to be true. What's the catch? Do they eat kittens? Fund terrorism? Work for Google?

 

 

*edit*

Does anyone know how to add those icons that are next to the URL in the navigation toolbar, and are on the tabs?

 

Also, stop pronouncing the topic title as " All yee people", the word "Ye" is pronounced as "Th"

Edited by Dirkmetal

Prism_Swords.png
Wait, isn't
<!--text-->

code for a commenting things out?

 

In this case, nope.

 

Looks to good to be true. What's the catch? Do they eat kittens? Fund terrorism? Work for Google?

 

The only problem I've noticed is that sometimes the control panel works slowly. That's pretty rare though.

 

Does anyone know how to add those icons that are next to the URL in the navigation toolbar, and are on the tabs?

 

They're called favicons. Add this code somewhere on the pages:

 

<link rel="icon" href="/favicon.gif" type="image/gif">

 

The favicon should be 32x32 pixels. PNG or GIF files can be used (remember to change GIF to PNG in the code if you use that). Upload it in the same folder as the pages.

The one I use is the following, that I find a little easier to remember.

 

<link rel="shortcut icon" href="images/favicon.ico" />

  • Author

Thanks everyone!

Prism_Swords.png

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.