1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.2 A category-image

Discussion in 'Styling and Customization Questions' started by bart, Nov 18, 2013.

  1. bart

    bart Active Member

    I would like to add a category image in all resource-cetagories. There's one place where I can't get it working: in the title.

    I would really like to change this:
    into this:
    <xen:title><img src="path_to_image/{$_category.resource_category_id}.png">{$category.category_title}</xen:title>
    It shows the image, but the title of the page is changed as well.

    I've been trying to get it done with a span-element, but that didn't work out either, because it leave a 50-pixel-high chunk of white under the title.

    <xen:title>{$category.category_title}</xen:title><span style="float:left;position:relative;top:-56px;left:6px;"><img src="path_to_image/{$category.resource_category_id}.png" width=48 height=48></span>
    Pfffeeeww. Something so futile is taking me a whole morning...
    Does anyone have a tip?
    Last edited: Nov 18, 2013
  2. Mouth

    Mouth Well-Known Member

    Category Descriptions allow HTML, so just add the image in there
  3. bart

    bart Active Member

    That was the tip I was waiting for.

    I finally got it to work:

    <xen:description class="baseHtml"><span style="float:left;margin-left:-56px;margin-bottom:-50px;top:-32px;position:relative;"><img src="path/to/{$category.resource_category_id}.png" width=48 height=48></span>{xen:raw $category.category_description}</xen:description>
    With this in the extra-template:

    .resource_category .titleBar

Share This Page