Page 1 of 1
Change color of first word?
Posted: Thu Jun 28, 2007 12:32 pm
by lordcoffee
Hi!
I want to modify the entry headers that the first word is always "grey" and all the others wich are following are "green".
Beispiel für das Problem von oben.
The problem I have is that I don't know how to "split" this entrytitle for the first word and the rest...
Code: Select all
{$entry.title|@default:$entry.body|truncate:37:" ..."}
Re: Change color of first word?
Posted: Thu Jun 28, 2007 12:57 pm
by garvinhicking
Hi!
Hm, are you really sure this makes sense? I believe in usual blog contents that might look quite odd?
I believe CSS3 has an option to format "first word" occurences!
To achieve that with Smarty you might need to register a custom modifier which explodes a string using the " " space character, replaces stuff inside the first word and then concatenates the rest. That's a lot of overhead and causes performance drops...
Best regards,
Garvin
Posted: Thu Jun 28, 2007 1:16 pm
by lordcoffee
Hmm really sad, because the template I'm trying to adapt (
this one) is looking very good with that
Maybe I'll combine the date and the header so I'll have two different parts wich can be edited:
01|Jan|07.Lorem ipsum dolor ...
Posted: Thu Jun 28, 2007 1:24 pm
by garvinhicking
Hi!
lordcoffee wrote:Hmm really sad, because the template I'm trying to adapt (
this one) is looking very good with that

But it only looks good because the demo uses those titles. Imagine usual Blog entries like:
"What the fuck is google all about"? which whould highlight "what".
Or "In God we trust" which would highlight "in"...I don't really think this way is usable for usual entries...even though it looks good on the page you refer to, of course
Putting the date there might look nice! Or maybe the authorname, or the category name(s)?
Regards,
Garvin
Posted: Thu Jun 28, 2007 3:02 pm
by lordcoffee
Well, I totaly forgot the "author" or "category" option. I think to display the category would be most logic option. so if I'm finished with that template we'll have another template and I'm writing a detailed (with screenshots and more) tutorial how to port templates to s9y. Maybe I'll need help with the englisch translation and maybe other languages.
Thanks and Greetings, Lordcoffee