<? DEW-CODE.COM  

Downloads

Assorted scripts  (1)
DewNewPHPLinks  (9)





Lost Password?
No account yet? Register

Dew-Code Newsfeed

Resources


 USdigitalcable.com

Dew-Code
Welcome, Guest
Please Login or Register.    Lost Password?
Re:Taking the links another step further (1 viewing) (1) Guest
Go to bottom Post Reply Favoured: 0
TOPIC: Re:Taking the links another step further
#1656
Tim (User)
Junior Boarder
Posts: 30
graphgraph
User Offline Click here to see the profile of this user
Taking the links another step further 11 Months, 1 Week ago Karma: 0  
Hi matey

cannot remember if I've asked this in the past, sorry if I have..

If you create separate .html pages (to work alongside the main site) can you add a piece of code that will bring in the cat lists as a menu, to save having to update every single page if we add new top level cats? even if the .html pages became .php in the format of .html...

Just we are wanting to expand our website to become more of news site as well, basically merge all our other sites into this one to create a major flag ship site...

Also - whilst I'm on it - is it very easy to edit templates to make your own?

thanks again for your help
 
Report to moderator   Logged Logged  
 
  The administrator has disabled public write access.
#1657
Dewed (Admin)
Admin
Posts: 605
graph
User Online Now Click here to see the profile of this user
Dew-Code.com
Re:Taking the links another step further 11 Months, 1 Week ago Karma: 9  
Probably the simplest way is to just include a single file in all of your pages. Your web server might be set to parse .html files for PHP. You can check.

in a test.html file , enter
Code:

<?php echo 'hello'; ?>
If you see "hello" when viewing the web page, then .html will be fine, otherwise you'll need to use .php , or possibly .shtml .php is likely the best choice to ensure things you might add later will work.... Or, use a line in your .htaccess file to tell your web server to run .html files as PHP Either way, includes are a god send.. If I need to create several static pages, where the info displayed is rarely changed I usually create a separate file for header, menu(s), and footer, then a blank template..., something like
Code:

<?php include('./includes/header.php'); include('./includes/menu.php'); ?> <div id=MAINCONTENT> MAIN CONTENT GOES HERE </div> <?php include('./includes/footer.php'); ?>
Anytime I need a new page, I just take a copy of my blank template, rename the file, such as about_us.php and fill in the main content area. Anytime I want to make a site wide edit to the header, for example I just need to edit one file, ./includes/header.php in this case. If you wanted to get fancy, you could make your menu.php file do database lookups, or possibly read in a file that is updated nightly via cron. Finally, I occasionally need to remind myself, and post here for posterity.. I am here to help people customize and/or troubleshoot the script I offer here. I also try to help people like yourself with general web programming and related stuff, but, I do have to draw a line somewhere regarding what I will provide for free. I am a human after all and among other things, I need to eat. If you prefer to figure this out, then I will certainly be here to help decipher error messages and try to point you in the right direction, but I can't write it for you unless of course you hire me to do so. Either way, you are the ambitious type and I like that, so tip #1 if you use Windows, grab the PHP help files in CHM format.. yet another god send http://www.php.net/download-docs.php
 
Report to moderator   Logged Logged  
 
Last Edit: 2011/06/08 12:52 By Dewed.
 
Nothing to it but to Dew it !
Dew-Code.com
  The administrator has disabled public write access.
#1658
Tim (User)
Junior Boarder
Posts: 30
graphgraph
User Offline Click here to see the profile of this user
Re:Taking the links another step further 11 Months, 1 Week ago Karma: 0  
fantastic - thanks, I'm having a go a adding some .html pages as well, but will have a look as I'm thinking of adding my blog content to.. feel free, when you get a moment to have a look and see what is going on... my plan, apart from making it a great site for us, it also to help promote your great software
 
Report to moderator   Logged Logged  
 
  The administrator has disabled public write access.
Go to top Post Reply
get the latest posts directly to your desktop
Outsource your projects to thousands of programmers at
ScriptLance.com
Newsflash
Interested in
advertising?

This space for rent!

Sign up for PayPal and start accepting credit card payments instantly.
Copyright Dew-Code 2008