Meta Tags and CSS Selectors

2,212 views
Skip to first unread message

DoomPirate

unread,
May 26, 2011, 7:09:02 PM5/26/11
to lif...@googlegroups.com
Hello,
Firstly, is it possible to use css selectors in conjunction with metatags?
I would like the meta description, title, etc to be changed according to the piece of content i am looking at.

Is this right?
"keywords [content]" #> "foo bar" &
"title [content]" #> "Title stuff in here!"


html
<div class="lift:metastuff">
<head>
<meta keywords="blank2" content="">
<meta title="blank" content="">
</head>
</div>

Thanks

Timothy Perrett

unread,
May 26, 2011, 7:41:33 PM5/26/11
to lif...@googlegroups.com
Given that your typical meta tag looks like:

<meta name="keywords" content="some words go here" />

You'd want:

"@keywords [content]" #> "foo bar" &
"@title [content]" #> "Title stuff in here!"

That'd work. 

Tim

DoomPirate

unread,
May 26, 2011, 7:45:17 PM5/26/11
to lif...@googlegroups.com
thanks! i bought your book btw

DoomPirate

unread,
May 26, 2011, 8:30:01 PM5/26/11
to lif...@googlegroups.com
also, how would one change the contents of a title tag using css selectors?
"@title" #> "Titlestuff?"

thanks

David Pollak

unread,
May 26, 2011, 9:15:46 PM5/26/11
to lif...@googlegroups.com
On Thu, May 26, 2011 at 5:30 PM, DoomPirate <nguyen....@gmail.com> wrote:
also, how would one change the contents of a title tag using css selectors?

"title *" #> "I am different"
 
"@title" #> "Titlestuff?"

thanks

--
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to lif...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.



--
Lift, the simply functional web framework http://liftweb.net

Timothy Perrett

unread,
May 27, 2011, 3:40:50 AM5/27/11
to lif...@googlegroups.com
Oh great :-)  In that case chapter 6 is your friend when it comes to CSS selectors: they are discussed in depth there.

Cheers, Tim
Reply all
Reply to author
Forward
0 new messages