ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Align Image with Top of Second Paragraph

September 15, 2010 11:43am

Subscribe [3]
  • #1 / Sep 15, 2010 11:43am

    Hi guys.

    I’m wondering if it’s possible to align an image (which is hard coded into the html) with the second paragraph of an EE textarea field.

    Here’s a snippet of simplified template code:

    <div class="content_485">
    {exp:channel:entries dynamic="no" channel="about_mission" disable="pagination|member_data" sort="asc"}
        {featured_photo}
        {intro_text}
    {/exp:channel:entries} 
    </div>

    In the code above {intro_text} is a textarea with 4 paragraphs. The photo is floated to the left so the text generated by {intro_text} wraps around the photo. What I’d like to do is have the photo float left, but align with the top of the second paragraph (instead of aligning with the top of the first paragraph as it’s currently doing).

    I’m not sure if this is possible, but any thoughts would be much appreciated.

  • #2 / Sep 17, 2010 2:04am

    brankin

    150 posts

    Only two ways I can think of doing that. First would be to type your first paragraph in the summary field and then type the rest of the entry in the main entry field. Just depends if you always want it at the second paragraph or not.

    <div class="content_485">
    {exp:channel:entries dynamic="no" channel="about_mission" disable="pagination|member_data" sort="asc"}
        {summary}
        {featured_photo}
        {intro_text}
    {/exp:channel:entries} 
    </div>


    Second would be to embed the image in the main body field using a WYSIWYG like Wygwam.

    Hope that helps.
    Later,
    Bryan

  • #3 / Sep 17, 2010 1:10pm

    Boyink!

    5011 posts

    Seems like you could use jQuery?  I know little about it but seems like you could target elements in specific positions like that.

  • #4 / Sep 17, 2010 3:05pm

    Thanks for the replies guys. I appreciate the suggestions.

    I’m definitely a fan of WYGWAM, but the styling that’s wrapped around the photos would (I believe) make that more hassle than it’d be worth to set up (I streamlined the code I embedded to make it easier to digest). However, for simple photo embeds that’s a great idea.

    As for using jQuery, that an interesting suggestion. I’ve only ever used it for basic movement, but maybe this is a good excuse to delve further into it’s bag of tricks.

    Either way, these are great jumping off points… thanks again for the replies.

    And Michael, thanks in general for your contributions to this community. I’m still very much a newbie to EE, but your free tutorials are absolutely what gave me the confidence to even attempt tackling a full blown EE site in the first place. Awesome stuff.

  • #5 / Sep 17, 2010 3:09pm

    Boyink!

    5011 posts

    Cool - glad to hear you found them useful!

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases