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
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Seperating Menus/Headers from page content

  • 17-09-2008 12:14pm
    #1
    Registered Users, Registered Users 2 Posts: 193 ✭✭


    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

  • Registered Users, Registered Users 2 Posts: 21,263 ✭✭✭✭Eoin


    Yes, look up "server side includes".


  • Registered Users, Registered Users 2 Posts: 193 ✭✭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, Registered Users 2 Posts: 3,428 ✭✭✭randombar


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


  • Registered Users, Registered Users 2 Posts: 21,263 ✭✭✭✭Eoin


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


  • Registered Users, Registered Users 2 Posts: 3,428 ✭✭✭randombar


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


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 193 ✭✭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, Registered Users 2 Posts: 3,428 ✭✭✭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, Registered Users 2 Posts: 193 ✭✭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.


  • Registered Users, Registered Users 2 Posts: 21,263 ✭✭✭✭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, Registered Users 2 Posts: 193 ✭✭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, Registered Users 2 Posts: 193 ✭✭unnamed


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

    Thanks for all the help.


Advertisement