Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Seperating Menus/Headers from page content

  • 17-09-2008 1:14pm
    #1
    Registered Users Posts: 185 ✭✭


    Hi,

    I'm looking for an application of techniques to automatically separate the headers/menus from the content of the same page.

    Basically, if I have several html pages from the same site (when creating a protoype or demo) most the these pages will have the same header/logo/menu and only the content of the page will change. What I'm looking for is a generic process to extract the changing content from each page and the headers/menus from each page.

    Is there any tools that do this? Is there a name for this?

    Thanks.


Comments

  • Moderators, Category Moderators, Motoring & Transport Moderators Posts: 21,238 CMod ✭✭✭✭Eoin


    Yes, look up "server side includes".


  • Registered Users Posts: 185 ✭✭unnamed


    eoin_s wrote: »
    Yes, look up "server side includes".

    Thanks for the reply, but I don't think this is what I'm looking for.

    Server side includes is the next step this is what I'll use once I have the menu/header and the content separated. What I want is a way to automatically separate the the menu/header from the content given several pages which identical menu/header.


  • Registered Users Posts: 3,352 ✭✭✭randombar


    <?php include "header.php"; ?>


  • Moderators, Category Moderators, Motoring & Transport Moderators Posts: 21,238 CMod ✭✭✭✭Eoin


    I think the OP is looking for a system to search the files, identify and extract the common header?


  • Registered Users Posts: 3,352 ✭✭✭randombar


    Find and replace?? Quick and easy! Notepad++ can do that over several open docs!


  • Advertisement
  • Registered Users Posts: 185 ✭✭unnamed


    eoin_s wrote: »
    I think the OP is looking for a system to search the files, identify and extract the common header?

    This is exactly what I'm looking for ... but also extract the individual content into separate pages without the header.
    GaryCocs wrote: »
    Find and replace?? Quick and easy! Notepad++ can do that over several open docs!

    I want it to be more automatic than that. It's part of a larger automated process with no user involvement.

    Imagine a command line version.

    htmlextract *.html

    on a directory with several html files.

    The output would be:
    header.html - This would be the header only.
    content1.html - Content only.
    .
    .
    .
    contentn.html

    If it doesn't exist I'll prob. create my own based on some sort of html/xml diff tool.

    Thanks again.


  • Registered Users Posts: 3,352 ✭✭✭randombar


    I'm thinking a wget command which would get all the html from a page and and then running regexp (or pregexp) to filter out what you want and don't want?


  • Registered Users Posts: 185 ✭✭unnamed


    GaryCocs wrote: »
    I'm thinking a wget command which would get all the html from a page and and then running regexp (or pregexp) to filter out what you want and don't want?

    The pages will be local so I don't think I'll need wget.

    My regex is reasonably good, but I'll need to generate an expression on the fly from the pages in question, some kind of diff seems like an easier approach.

    I guess what I was really hoping to get out of this was to see if this was a common thing to do, and if it the process had an actual name, or even if there was common techniques for this.


  • Moderators, Category Moderators, Motoring & Transport Moderators Posts: 21,238 CMod ✭✭✭✭Eoin


    I don't know about anyone else, but extracting the common parts would be the first thing I would do, so there wouldn't need to be any automated process in the first place.


  • Registered Users Posts: 185 ✭✭unnamed


    eoin_s wrote: »
    I don't know about anyone else, but extracting the common parts would be the first thing I would do, so there wouldn't need to be any automated process in the first place.

    Do you mean manually? This won't work for me, it would take me years to do what I have to do manually, there are many many sites involved.


  • Advertisement
  • Registered Users Posts: 185 ✭✭unnamed


    I think I found a technique based on XSLT that might work.

    Thanks for all the help.


Advertisement