Topic: How can I use different styles of posts for different members of a blog? (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=29596" title="Pages that link to Topic: How can I use different styles of posts for different members of a blog? (Page 1 of 1)" rel="nofollow" >Topic: How can I use different styles of posts for different members of a blog? <span class="small">(Page 1 of 1)</span>\

 
robogrobo
Obsessive-Compulsive (I) Inmate

From: in a room with a moose
Insane since: Oct 2007

posted posted 10-05-2007 04:18

I have a group blog at robogrobo.blogspot.com. The members are "Travis" & "Raye". I am trying to give each post a different style, that means a different backgrounds, fonts, colors etc.

Google has a help file on how to do this. The help file is located at: LINK

A summary of the tutorial is as follows;
This code is replaced by a post's content: <data:post.body/>...
This code is replaced by an author's name: <data:post.author/>...
Wrap the post data (<data:post.body/>) in span tags and set the class to it's author's name (<data:post.author>)...
Define a style for each user...

.Raye {
background: yellow;
}

.Travis {
background: blue;
}

<span class="<data:post.author/>">
<data:post.body/>
</span>

Blogger immediately rejects the code. It says something about too many carrots. I pruned some carrots...
<span class="data:post.author/">
<data:post.body/>
</span>

Blogger doesn't complain when I save the file but it doesn't change my layout either. More bugs. Drat. Stomp-- Splat!

What went wrong? Was is the way I wrote my styles in? I test this by adding a more explicit span around the <data:post.body> element...

<span class="Raye"><span class="data:post.author/">
<data:post.body/>
</span>
</span>

The stylesheet for "Raye" now applies to both "Travis" & "Raye", just as would be expected.

Perhaps the

code:
<data:post.author/>

element is broken. I try placing a bunch of them right after the

code:
<data:post.author/>

element. This makes it appear as though I wrote Travis Travis Travis at the end of my post.

Does anyone have any suggestions? I'm really new to this CSS/XML stuff and have been as thorough as i know how to be.

Thanks,
Travis McKinney

edit: formated post better/removed slimies

(Edited by robogrobo on 10-05-2007 04:21)

(Edited by robogrobo on 10-05-2007 04:22)

(Edited by robogrobo on 10-05-2007 04:24)

(Edited by robogrobo on 10-05-2007 04:24)

(Edited by robogrobo on 10-05-2007 04:30)

Tyberius Prime
Maniac (V) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 10-05-2007 09:54

Your problem most likely is, that you don't really have a <data:post.author/>
in there, instead you have data:post.author/ that's not being replaced.

Hint:
You can always see what happens by hitting edit/view source (or similiar) in your browser.

Now I don't know much about blogger styles in general,
but

code:
<span class="<data:post.author/>">
     <data:post.body/>
</span>


is what the tutorial says and what you'll need.

Are you sure you're using 'layouts' and not 'classic templates'?

So long,

->Tyberius Prime

(Edited by Tyberius Prime on 10-05-2007 09:57)

robogrobo
Nervous Wreck (II) Inmate

From: in a room with a moose
Insane since: Oct 2007

posted posted 10-06-2007 00:14

According to this google help doc I am definitely using layouts because 'robot elephants' is a newly created blog and 'layout' is displayed next to 'settings'. When I edit the xml to their specifications, I get the following error:

quote:
We were unable to save your template
Please correct the error below, and submit your template again.
Your template could not be parsed as it is not well-formed. Please make sure all XML elements are closed properly.
XML error message: The value of attribute "class" associated with an element type "null" must not contain the '<' character.



After Blogger does it's conversion dance and renders a post for the browser, it looks like the following code.

<span class='data:post.author'>
me too!
</span>
Raye
Raye
Raye

The lack of carrots around data:post.author indicates that Blogger did not save my changes. Is this an error on the end of their XML parser's definitions?

Are there any hacks around this? Possible something css based such as (sudocode):

"Raye Raye Raye":before {
background:blue;
}
"Travis Travis Travis":before {
background:red;
}

Thank's for responding,
-Travis

(Edited by robogrobo on 10-06-2007 00:14)



Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu