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.

How do I call a Catergory Image?

March 02, 2008 4:21pm

Subscribe [2]
  • #1 / Mar 02, 2008 4:21pm

    MichaelHWG

    24 posts

    I want the Cat Image to have the summary text wrap around it.

    So I did this

    {exp:weblog:categories}
    {category_image}
    {/exp:weblog:categories}{summary}

    But that doesn’t seem to work, am I missing something?

  • #2 / Mar 02, 2008 7:23pm

    tbritton

    714 posts

    Yes - you are missing that the summary custom field has to be between weblog:entries tags.

    {exp:weblog:categories}
    {category_image}
    {/exp:weblog:categories}
    {exp:weblog:entries limit="1"}{summary}{/exp:weblog:entries}

    Or nest that between the category tags.

    {exp:weblog:categories}
    {category_image}
    {exp:weblog:entries limit="1"}{summary}{/exp:weblog:entries}  
    {/exp:weblog:categories}

    Or place the category tags instead in the weblog:entries tags.

    {exp:weblog:entries limit="1"}
    {categories}
    {category_image}
    {/categories}
    {summary} 
    {/exp:weblog:entries}

    Terry

  • #3 / Mar 02, 2008 7:25pm

    MichaelHWG

    24 posts

    Hi Terry

    It’s set up like this

    {exp:weblog:entries limit="1"}
    {categories}
    {category_image}
    {/categories}
    {summary} 
    {/exp:weblog:entries}

    The catergory image still doesn’t display. I did select a catergory for that page and there is an image for it.

  • #4 / Mar 02, 2008 7:27pm

    tbritton

    714 posts

    Then I’m flummoxed, because you did it right, as far as I can see.

    Could it be the class you’ve used? A div problem?

    Wild try- remove the quotes from {category_image}??

    Terry

  • #5 / Mar 02, 2008 7:30pm

    MichaelHWG

    24 posts

    The class just tells the image to stay to the right, and I’ve tested it
    http://www.hardwaregeeks.com/index.php/tempindex

    Just when I change it too
    {exp:weblog:entries limit="1"}
    {categories}
    {category_image}
    {/categories}
    {summary}
    {/exp:weblog:entries}

    the image doesn’t show.

  • #6 / Mar 02, 2008 7:33pm

    tbritton

    714 posts

    No, it wouldn’t. You need the < img src=”{category_image}” tags.

    Hmmmmm…. thinking….

    Terry

  • #7 / Mar 02, 2008 7:35pm

    tbritton

    714 posts

    When you do:

    {exp:weblog:entries limit="1"}
    {categories}
    {category_image}
    {/categories}

    At LEAST the category_image text should appear. After all, it really is only a custom text field - nothing makes it any different than any other custom category field in that regard.

    Terry

  • #8 / Mar 02, 2008 7:35pm

    MichaelHWG

    24 posts

    Is it possible I set the catergories up wrong?

  • #9 / Mar 02, 2008 7:37pm

    MichaelHWG

    24 posts

    When you do:

    {exp:weblog:entries limit="1"}
    {categories}
    {category_image}
    {/categories}

    At LEAST the category_image text should appear. After all, it really is only a custom text field - nothing makes it any different than any other custom category field in that regard.

    Terry

    let me try

  • #10 / Mar 02, 2008 7:39pm

    tbritton

    714 posts

    try as the variable name {category_image_url}.

    I can’t find the docs saying what the variable short name actually is!

    [Edit - found it - it should be category_image as you are using it.]

    Terry

  • #11 / Mar 02, 2008 7:39pm

    MichaelHWG

    24 posts

    It shows the URL for the Image but when I put it in the <> it doesn’t lol

    I am stumped and it’s probably something simiple.

  • #12 / Mar 02, 2008 7:42pm

    tbritton

    714 posts

    try stripping out the class and align info from between the tags.

    <div class="newsimg" align="right">
    {category_image}</div>

      ????

    Terry

  • #13 / Mar 02, 2008 7:44pm

    MichaelHWG

    24 posts

    I got it to work, my problem was I had an open div tag lol

    sorry for the trouble and thanks for the help!!!

  • #14 / Mar 02, 2008 7:45pm

    tbritton

    714 posts

    You bet! Those div buggers!!!

    Terry

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

ExpressionEngine News!

#eecms, #events, #releases