Forum Moderators: not2easy

Message Too Old, No Replies

Can text content be created by a CSS file?

Rather than be in the page's HTML?

         

dickbaker

11:18 pm on Nov 20, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have a situation where I want to be able to update a sentence at the top of a couple of thousand pages every day. I can't do it with ASP, as some of the pages are already querying a database.

I can do it very easily with javascript, but I'd like to have the sentence to be able to be crawled by the SE's.

Is there a way to create the entire sentence in a CSS file, and then reference it on the page in a <div> tag or something like that?

I've been searching all over the internet and can't find any solution. Maybe that's because it can't be done?

jackherbert

12:17 am on Nov 21, 2010 (gmt 0)

10+ Year Member



It seems unlikely. I never heard of putting content in css.
A php include might be an easy way around your problem.

tangor

12:43 am on Nov 21, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



A second (and earlier method) is Server Side Include (SSI).

dickbaker

3:57 am on Nov 21, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I can't do PHP because the pages are a mix of html and asp.

A search engine bot couldn't read text from an SSI, right?

I have it working fine with a javascript document.write, but I'd like the bots to be able to read it.

yaix2

6:31 am on Nov 21, 2010 (gmt 0)

10+ Year Member



You could do
div:after { content:'My phrase for today.'; }
but that is as crawlable (or un-crawlable) as Javascript. If you want it indexed, you will need to put it into the HTML, so Server Side Include (or ASP if the page is created by it anyway) is probably the best way.

A search engine bot couldn't read text from an SSI, right?

ASP or SSI create HTML as output. The SE bot has no idea who or what created the HTML. It just reads a long text string with HTML tags in it, that's your page.

yaix2

6:35 am on Nov 21, 2010 (gmt 0)

10+ Year Member



I can't do it with ASP, as some of the pages are already querying a database.

How is that a reason?

Just create a text file with your 365 phrases, one for every day, one phrase per line. Then get the day-of-the-year with ASP and read that line# from the text file. That will take less than 0.01 seconds to run.

tangor

6:56 am on Nov 21, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Take a look at Server Side Includes. This is what you are looking for.

dickbaker

11:37 pm on Nov 21, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Text file in SSI worked. I didn't think it would be crawlable, but it is.

Simple solutions. I love it when that happens.

Thanks.

jackherbert

12:22 pm on Nov 23, 2010 (gmt 0)

10+ Year Member



I'd never heard of SSI before and it's great. Cheers tangor!

topr8

12:56 pm on Nov 23, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



>>I have it working fine with a javascript document.write, but I'd like the bots to be able to read it.

seems like you're already sorted but google certainly reads simple javascript like a document write