First Letter is a quickly adapted plugin, based off of Drop Caps, to let you wrap the first letter of your weblog field to a CSS/HTML tag of your choosing.
Before: The quick brown fox jumps over a lazy dog.
{exp:weblog:entries entry_id="41"}
{exp:firstletter tag="em" key="4" class="grand"}
{body}
{/exp:firstletter}
{/exp:weblog:entries}
After: <em class=”grand”>T</em>he quick brown fox jumps over a lazy dog.
Just curious why you don’t just use :first-letter in a CSS file?
I needed a drop cap on the first letter of the body, not every paragraph… but if I add a class on the first paragraph only, then it defeats the point of the client not having to style their entry.
Do you know of a better way?
Using :first-child? Can you actually combine :first-child and :first-letter? Although I don’t see why not. That would work in a perfect world, at least, not sure if support is widespread enough yet.
EDIT: Not supported by Explorer 6 on Windows. (Too bad.) Explorer 7, Safari 3.0, iCab and Opera support it, so I have no doubt about Firefox.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.