modular code

Discussion in 'HTML' started by cbnewman@gmail.com, Jun 11, 2007.

  1. Guest

    Is there any way to use CSS to implement modular code? In other words,
    if I have a footer that I want to be displayed on every page but I
    only want to update it in one place (perhaps a single HTML file) how
    can I get it to display on every page on my site? I know I could
    implement this solution with frames, but I would rather not...
     
    , Jun 11, 2007
    #1
    1. Advertising

  2. Ed Seedhouse Guest

    On Mon, 11 Jun 2007 01:50:38 -0000, wrote:

    >Is there any way to use CSS to implement modular code?


    No.

    >In other words,
    >if I have a footer that I want to be displayed on every page but I
    >only want to update it in one place (perhaps a single HTML file) how
    >can I get it to display on every page on my site?


    Not with CSS.


    >I know I could
    >implement this solution with frames, but I would rather not...


    And you shouldn't. Use server side includes, PHP, ASP, JSP or some
    other serve side technology.
     
    Ed Seedhouse, Jun 11, 2007
    #2
    1. Advertising

  3. dorayme Guest

    In article
    <>,
    wrote:

    > Is there any way to use CSS to implement modular code? In other words,
    > if I have a footer that I want to be displayed on every page but I
    > only want to update it in one place (perhaps a single HTML file) how
    > can I get it to display on every page on my site? I know I could
    > implement this solution with frames, but I would rather not...


    Look up "server side include" or "php include"

    --
    dorayme
     
    dorayme, Jun 11, 2007
    #3
  4. Ed Mullen Guest

    Ed Seedhouse wrote:
    > On Mon, 11 Jun 2007 01:50:38 -0000, wrote:
    >
    >> Is there any way to use CSS to implement modular code?

    >
    > No.
    >
    >> In other words,
    >> if I have a footer that I want to be displayed on every page but I
    >> only want to update it in one place (perhaps a single HTML file) how
    >> can I get it to display on every page on my site?

    >
    > Not with CSS.
    >
    >
    >> I know I could
    >> implement this solution with frames, but I would rather not...

    >
    > And you shouldn't. Use server side includes, PHP, ASP, JSP or some
    > other serve side technology.
    >
    >


    And if your ISP doesn't provide such technology, you can do it with
    javascript. There are some people who don't allow javascript while
    browsing so you'll need to decide if that matters to you.

    --
    Ed Mullen
    http://edmullen.net
    http://mozilla.edmullen.net
    http://abington.edmullen.net
     
    Ed Mullen, Jun 11, 2007
    #4
  5. Ed Seedhouse Guest

    On Sun, 10 Jun 2007 22:15:20 -0400, Ed Mullen <> wrote:

    >Ed Seedhouse wrote:
    >> On Mon, 11 Jun 2007 01:50:38 -0000, wrote:
    >>
    >>> Is there any way to use CSS to implement modular code?

    >>
    >> No.
    >>
    >>> In other words,
    >>> if I have a footer that I want to be displayed on every page but I
    >>> only want to update it in one place (perhaps a single HTML file) how
    >>> can I get it to display on every page on my site?

    >>
    >> Not with CSS.
    >>
    >>> I know I could
    >>> implement this solution with frames, but I would rather not...

    >>
    >> And you shouldn't. Use server side includes, PHP, ASP, JSP or some
    >> other serve side technology.
    >>

    >And if your ISP doesn't provide such technology, you can do it with
    >javascript. There are some people who don't allow javascript while
    >browsing so you'll need to decide if that matters to you.


    Good points, I should have mentioned javascript and the problem with it
    myself.
     
    Ed Seedhouse, Jun 11, 2007
    #5
  6. While the city slept, Ed Mullen () feverishly typed...

    [server side includes]

    > And if your ISP doesn't provide such technology, you can do it with
    > javascript. There are some people who don't allow javascript while
    > browsing so you'll need to decide if that matters to you.


    The most important visitor your site could ever have does not have
    javascript enabled. This visitor's name is "googlebot". Think very carefully
    before you exclude content from this visitor ;-)

    Cheers,
    Nige

    --
    Nigel Moss http://www.nigenet.org.uk
    Mail address will bounce. | Take the DOG. out!
    "Your mother ate my dog!", "Not all of him!"
     
    nice.guy.nige, Jun 12, 2007
    #6
  7. Ed Mullen Guest

    nice.guy.nige wrote:
    > While the city slept, Ed Mullen () feverishly typed...
    >
    > [server side includes]
    >
    >> And if your ISP doesn't provide such technology, you can do it with
    >> javascript. There are some people who don't allow javascript while
    >> browsing so you'll need to decide if that matters to you.

    >
    > The most important visitor your site could ever have does not have
    > javascript enabled. This visitor's name is "googlebot". Think very carefully
    > before you exclude content from this visitor ;-)
    >
    > Cheers,
    > Nige
    >


    Actually, Google has many Webmaster tools to account for this. And,
    careful design can handle the rest.

    I use javascript to create my menus on the fly. Still, every link on my
    site of about 200 pages is listed in Google. At the top? That's
    another question. ;-)

    The bugaboo about javascript is just that, unfounded in practice. And,
    given that many major ISPs don't provide server-side solutions, it may
    be the only viable alternative.

    Will a few paranoiacs be inconvenienced visiting my site? Maybe. I
    don't care. It's a hobby for me. I'm not careless about my hobbies but
    I'm not obsessed about them, either. And I DO provide a site map so
    that the truly paranoid can find all the pages.

    And I do ascribe to the Lincolnesque observation about pleasing all the
    people all time: It cannot be done. So I have evaluated my own
    situation and made my choices. And have done so knowing the trade-offs.
    And, in five years I've never had anyone object to the use of
    javascript on my site, but I have had many emails of thanks.

    Hey, again, it's not ibm.com (which uses javascript) but I'm doing ok.
    And so is IBM. And msn.com. And yahoo.com. And amazon.com etc. Geez,
    people. Lighten up. javascript isn't evil.

    --
    Ed Mullen
    http://edmullen.net
    http://mozilla.edmullen.net
    http://abington.edmullen.net
     
    Ed Mullen, Jun 12, 2007
    #7
  8. Gazing into my crystal ball I observed Ed Mullen <>
    writing in news::

    > Ed Seedhouse wrote:
    >> On Mon, 11 Jun 2007 01:50:38 -0000, wrote:
    >>
    >>> Is there any way to use CSS to implement modular code?

    >>
    >> No.
    >>
    >>> In other words,
    >>> if I have a footer that I want to be displayed on every page but I
    >>> only want to update it in one place (perhaps a single HTML file) how
    >>> can I get it to display on every page on my site?
    >>> I know I could
    >>> implement this solution with frames, but I would rather not...

    >>
    >> And you shouldn't. Use server side includes, PHP, ASP, JSP or some
    >> other serve side technology.

    >
    > And if your ISP doesn't provide such technology, you can do it with
    > javascript. There are some people who don't allow javascript while
    > browsing so you'll need to decide if that matters to you.
    >


    Or consider a preprocessor.

    --
    Adrienne Boswell at Home
    Arbpen Web Site Design Services
    http://www.cavalcade-of-coding.info
    Please respond to the group so others can share
     
    Adrienne Boswell, Jun 12, 2007
    #8
  9. Ed Seedhouse wrote:

    >>if I have a footer that I want to be displayed on every page but I
    >>only want to update it in one place (perhaps a single HTML file) how
    >>can I get it to display on every page on my site?

    >
    >
    > Not with CSS.


    Why not? Can a CSS file not contain visible text?

    DoDi
     
    Hans-Peter Diettrich, Jun 16, 2007
    #9
  10. Gazing into my crystal ball I observed Hans-Peter Diettrich <DrDiettrich1
    @aol.com> writing in news::

    > Ed Seedhouse wrote:
    >
    >>>if I have a footer that I want to be displayed on every page but I
    >>>only want to update it in one place (perhaps a single HTML file) how
    >>>can I get it to display on every page on my site?

    >>
    >>
    >> Not with CSS.

    >
    > Why not? Can a CSS file not contain visible text?
    >


    No, an external style sheet is just that, a Style Sheet, only affecting
    presentation of the document's markup. The only time you would see text
    from a stylesheet is in the case of the Content property, used in
    conjunction with :before and :after pseudo-elements.


    --
    Adrienne Boswell at Home
    Arbpen Web Site Design Services
    http://www.cavalcade-of-coding.info
    Please respond to the group so others can share
     
    Adrienne Boswell, Jun 16, 2007
    #10
  11. Adrienne Boswell wrote:

    > Hans-Peter Diettrich wrote:
    >> Ed Seedhouse wrote:
    >> [ wrote:]
    >>>> if I have a footer that I want to be displayed on every page but I
    >>>> only want to update it in one place (perhaps a single HTML file)
    >>>> how can I get it to display on every page on my site?
    >>>
    >>> Not with CSS.

    >>
    >> Why not? Can a CSS file not contain visible text?

    >
    > No, an external style sheet is just that, a Style Sheet, only
    > affecting presentation of the document's markup. The only time you
    > would see text from a stylesheet is in the case of the Content
    > property, used in conjunction with :before and :after
    > pseudo-elements.


    ...with the caveat that it will not work in the oft-used browser-like
    operating system component.

    #contentbox:after {
    content: "Copyright 2007. All rights reserved.";
    }

    Note you can't place any HTML in this content.

    --
    -bts
    -Motorcycles defy gravity; cars just suck
     
    Beauregard T. Shagnasty, Jun 16, 2007
    #11
  12. Beauregard T. Shagnasty wrote:

    >>>Why not? Can a CSS file not contain visible text?

    >>
    >>No, an external style sheet is just that, a Style Sheet, only
    >>affecting presentation of the document's markup. The only time you
    >>would see text from a stylesheet is in the case of the Content
    >>property, used in conjunction with :before and :after
    >>pseudo-elements.

    >
    >
    > ...with the caveat that it will not work in the oft-used browser-like
    > operating system component.
    >
    > #contentbox:after {
    > content: "Copyright 2007. All rights reserved.";
    > }
    >
    > Note you can't place any HTML in this content.


    Thanks for all your answers :)

    Another idea: what about browser-plugins?

    In general it might be a bad idea, to force users to install a plugin
    before they can see a particular page - what if everybody would do that?
    But in my current project the users would be happy, if they could extend
    the browser capabilities as desired, by installing a plugin.

    Concrete question: what's the task of a plugin, what makes the browser
    activate it? Is a plugin related to a special object type, or what else?

    DoDi
     
    Hans-Peter Diettrich, Jun 16, 2007
    #12
  13. Hans-Peter Diettrich wrote:

    > Beauregard T. Shagnasty wrote:
    >> ...with the caveat that it will not work in the oft-used browser-like
    >> operating system component. [which is IE.]
    >>
    >> #contentbox:after {
    >> content: "Copyright 2007. All rights reserved.";
    >> }
    >>
    >> Note you can't place any HTML in this content.

    >
    > Thanks for all your answers :)
    >
    > Another idea: what about browser-plugins?


    Is this for a public website? If only for an intranet, where you or
    your company has full control, go for it, but if for the WWW, just drop
    the idea.

    > In general it might be a bad idea, to force users to install a plugin
    > before they can see a particular page


    This might apply only to a specialty site. Music.. videos.. but
    certainly not for a simple footer.

    > - what if everybody would do that?


    The WWW would be an even larger mess.

    > But in my current project the users would be happy, if they could
    > extend the browser capabilities as desired, by installing a plugin.


    You should drop the idea of 'plugins' just to see text you want to
    include in a file.

    > Concrete question: what's the task of a plugin, what makes the
    > browser activate it? Is a plugin related to a special object type, or
    > what else?


    Can't be answered, as a 'plugin' could be a thousand things. I'm
    certainly not going to install unnecessary 'plugins' in my browsers just
    to see a copyright notice.

    As the original post was about inserting common footer text on all
    pages, the answer still remains to use either SSI, PHP includes or
    similar, preprocessing, or an external JavaScript called by each page's
    code. (Note that JavaScript will not be seen by 5-10% of visitors.)

    --
    -bts
    -Motorcycles defy gravity; cars just suck
     
    Beauregard T. Shagnasty, Jun 16, 2007
    #13
  14. Beauregard T. Shagnasty wrote:

    >>But in my current project the users would be happy, if they could
    >>extend the browser capabilities as desired, by installing a plugin.

    >
    >
    > You should drop the idea of 'plugins' just to see text you want to
    > include in a file.


    It's more complicated than that. I have to preprocess HTML Help pages,
    which contain links as <MSHelp.link ...> tags. Actually I have no idea
    how to make such links work, other than replacing them by ordinary <A
    ....> elements. But I'm looking for alternatives, perhaps some guru can
    point me into a better direction.

    DoDi
     
    Hans-Peter Diettrich, Jun 17, 2007
    #14
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jim Lewis

    procedures vs. modular design?

    Jim Lewis, Nov 30, 2004, in forum: VHDL
    Replies:
    3
    Views:
    505
    Guenter Wolpert
    Dec 1, 2004
  2. Tohid

    Modular Problem!

    Tohid, Oct 22, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    338
    Tohid
    Oct 22, 2003
  3. Murl Brown

    Creating a dynamic modular site...

    Murl Brown, Sep 5, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    306
  4. Nick Goloborodko

    ASP.NET modular architecture

    Nick Goloborodko, Mar 10, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    3,826
    Steven Cheng[MSFT]
    Mar 14, 2005
  5. Dan Stromberg
    Replies:
    2
    Views:
    479
    Michael Spencer
    Jan 22, 2005
Loading...

Share This Page