frames? php includes? - Post ID 199955

User 473697 Photo


Registered User
2 posts

Hi everyone,

I'm Joe still a beginner-intermediate webmaster. I haven't built a website by code in a long while so when I wanted to make a site recently I bought a WYSIWYG from Serif. Not bad but I miss the control we have with a straight html code editor.

My question is about frames or master borders. In WYSIWYGS they allow you to create a "master border" that is like a header or side margin or a footer THAT you can place on any page of the site. You can make several master borders and use them on different pages for different sets of navigation
panels. I had done this with PHP includes as well. Just change the master border or the include and that change appears on all the pages that have it.

But... how is this done with only an html editor? Is it done with Frames? When I learned html long ago frames were discouraged? Are they back in?

Without using php includes or a wysiwyg how can I create the same effect as master borders with the Coffee-cup suite of software? I am tempted to buy a bundle or two or the whole bundled-suite.

I appreciate your comments.

Joe




Canvasjoe
User 187934 Photo


Senior Advisor
20,247 posts

The html editor will work with PHP.:cool:
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 122279 Photo


Senior Advisor
14,571 posts
Online Now

Hi Joe,

Frames are OUT, php includes are IN. You don't make frames to include php code, instead you call your html page something like e.g. master.php. You just make one normal html page as a master, with header, footer and navigation. Then the fun begins:

Cut out the header, footer, navigation and any other bits that is supposed to be on every page. Create them each as its own file, like header.php, footer.php etc. Those files do NOT start with doctype, head, title etc, just the bit you chop off the normal file. I always put those chopped off files in a folder that I call 'inc'. Then, in the empty space that appears in the normal master.php you write
<?php

include("inc/header.php");

?>
And similar for the other empty spaces. That's all there is. Then you can use the master.php to create each page by just changing out the other contents.
Ha en riktig god dag!
Inger, Norway

My work in progress:
Components for Site Designer and the HTML Editor: https://mock-up.coffeecup.com


User 473697 Photo


Registered User
2 posts

Inger and Eric thank you very much.

Basically the master.php is my site template and I add includes to it.
Then the entire site is php pages, which is good.

I have been aware of this. Just wondering if the same could be
accomplished with only html pages.

I'll stay with php then and embrace includes. Very cool.

Thank you both for replying.

Joe
Canvasjoe
User 38401 Photo


Senior Advisor
10,951 posts

You can always attempt to work with sometimes servers actually do allow you to add PHP Includes to your pages without having to change to the .php extension, but you would need to check with your site and server on that to see if it's possible on yours. Most of the time not.
User 187934 Photo


Senior Advisor
20,247 posts

Try adding this line to you .htaccess page.
AddHandler php-script .html
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 38401 Photo


Senior Advisor
10,951 posts

Thanks Eric, I couldn't remember what that line was, I guess I'll make a snippet of it :)
User 2733 Photo


Ambassador
426 posts

Inger wrote:
<?php

include("inc/header.php");

?>


PHP include is a statement not a function. The parens are not necessary.
Let's not get all hurt.
User 2733 Photo


Ambassador
426 posts

Eric Rohloff (Rolly) wrote:
Try adding this line to you .htaccess page.
AddHandler php-script .html


Adding a handler to parse .html files like .php just adds overhead to the server. There is no good reason to do this. And, if you're going to give me the "but all of our pages on our website have been .html for years and links will break" argument, I say to you, research mod_rewrite on Apache.
Let's not get all hurt.
User 187934 Photo


Senior Advisor
20,247 posts

I'm not giving you anything. :lol: I'm only giving the user options.;)
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.