XF 2.2 Replace category title with image?

Luke247

Member
Hello,

On category view, how can I remove the category title and put an image instead? I would like to have a different image for each category.

Thank you.
 

Mr Lucky

Well-known member
Deleted previous answer, it was wrong

To hide title (category id 1)

Code:
.block--category1 h2.block-header a
    {display:none}

To add an icon
Code:
.block.block--category.block--category1 .block-header:before {
 
    .m-faBase();
    content: '\f79f';
}

For an image, I'm not sure
 

Mr Lucky

Well-known member
Try this for image

Code:
.block.block--category.block--category1 .block-header:before {
 
background-image:url("/link_to_image)";
   height:50px;
width:200px
}

EDIT: the above does not work as a link though :(
 

Mr Lucky

Well-known member
For a forum node it is easy, as you can just add a normal image with link html to the description, but for categories, the hide title code (h2) above also hides the description which it doesn't do for forums ...hmmm...
 
Last edited:

Luke247

Member
Deleted previous answer, it was wrong

To hide title (category id 1)

Code:
.block--category1 h2.block-header a
    {display:none}

To add an icon
Code:
.block.block--category.block--category1 .block-header:before {
 
    .m-faBase();
    content: '\f79f';
}

For an image, I'm not sure

Sorry for the confusion. I want the category title removed from the category page, not the forum list. And, an image to replace the category title (on the category pag), with a different image of my choice for each category.

hope that makes sense
 

Baby Community

Well-known member
Deleted previous answer, it was wrong

To hide title (category id 1)

Code:
.block--category1 h2.block-header a
    {display:none}

To add an icon
Code:
.block.block--category.block--category1 .block-header:before {
 
    .m-faBase();
    content: '\f79f';
}

For an image, I'm not sure
Which template should we not add in the child theme we want to edit?
 
Top