modular code
am 11.06.2007 03:50:38 von cbnewman
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...
Re: modular code
am 11.06.2007 04:03:42 von Ed Seedhouse
On Mon, 11 Jun 2007 01:50:38 -0000, cbnewman@gmail.com 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.
Re: modular code
am 11.06.2007 04:04:45 von dorayme
In article
<1181526638.555875.69330@w5g2000hsg.googlegroups.com>,
cbnewman@gmail.com 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
Re: modular code
am 11.06.2007 04:15:20 von Ed Mullen
Ed Seedhouse wrote:
> On Mon, 11 Jun 2007 01:50:38 -0000, cbnewman@gmail.com 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
Re: modular code
am 11.06.2007 05:21:58 von Ed Seedhouse
On Sun, 10 Jun 2007 22:15:20 -0400, Ed Mullen wrote:
>Ed Seedhouse wrote:
>> On Mon, 11 Jun 2007 01:50:38 -0000, cbnewman@gmail.com 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.
Re: modular code
am 12.06.2007 01:22:13 von nigel_moss
While the city slept, Ed Mullen (ed@edmullen.net) 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. nigel@DOG.nigenet.org.uk | Take the DOG. out!
"Your mother ate my dog!", "Not all of him!"
Re: modular code
am 12.06.2007 02:24:38 von Ed Mullen
nice.guy.nige wrote:
> While the city slept, Ed Mullen (ed@edmullen.net) 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
Re: modular code
am 12.06.2007 06:52:46 von Adrienne Boswell
Gazing into my crystal ball I observed Ed Mullen
writing in news:luSdnQvHpMWlLfHbnZ2dnUVZ_tfinZ2d@comcast.com:
> Ed Seedhouse wrote:
>> On Mon, 11 Jun 2007 01:50:38 -0000, cbnewman@gmail.com 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
Re: modular code
am 16.06.2007 04:01:31 von Hans-Peter Diettrich
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
Re: modular code
am 16.06.2007 09:35:37 von Adrienne Boswell
Gazing into my crystal ball I observed Hans-Peter Diettrich
@aol.com> writing in news:5dgvk6F34a1edU3@mid.individual.net:
> 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
Re: modular code
am 16.06.2007 14:59:46 von a.nony.mous
Adrienne Boswell wrote:
> Hans-Peter Diettrich wrote:
>> Ed Seedhouse wrote:
>> [cbnewman@gmail.com 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
Re: modular code
am 16.06.2007 17:10:48 von Hans-Peter Diettrich
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
Re: modular code
am 16.06.2007 18:33:55 von a.nony.mous
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
Re: modular code
am 17.06.2007 12:49:16 von Hans-Peter Diettrich
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 tags. Actually I have no idea
how to make such links work, other than replacing them by ordinary
....> elements. But I'm looking for alternatives, perhaps some guru can
point me into a better direction.
DoDi