test
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • markkusq3po Friend
    #179647

    Hello, i want to give the contents different icons, based on category, so that when a post is from category x an x-icon is shown and from category y an y-icon is shown in the place of the “hot” icon or additionally to that.
    Or perhaps instead of the textbased category line an icon instead.
    Thanks Markus

    arucardx Friend
    #463169

    I saw a site that did this before. The guy modded his site very beautifully with each category having their own image but unfortunately I didn’t take down the url and can’t find it again. Sadly ppl don’t seems to like to share their work =(

    Off my mind, I think I have a rough idea of how it can be done, but it’s not a very elegant solution and it cannot work together with hot icon. Not sure if you’re using K2 or Joomla but I’ll assume it’s K2.

    I’m not good with PHP and this is untested so there might be some syntax error though the general idea is there. The code below are to be inserted in templatehtmlcom_k2ja_wallcategory_item.php

    You need to declare a variable to store the category name as a string. Then add the text item- before the category name so category say… Computer becomes item-computer.
    [PHP]<?php
    $caticon = ‘item-‘+($this->item->category->name);
    ?>[/PHP]

    Then you need to search for <!– Start K2 Item Layout –> and insert this code inside <div class=”item> where hot icon is. It must be defined inside the div class.
    [PHP]<?php if(!empty($this->item->category->name)) echo $caticon ?>[/PHP]

    Now you just need to create the respective CSS buttons in template.css for each category (Example .item-computer as the CSS suffix) and you will get individual icons for each category. You can remove the hot code from there if you want, cause only 1 icon can be displayed. I’m not sure why, can’t figure out. My guess is due to display:block

    markkusq3po Friend
    #463173

    Hi, thanks meanwhile for the answer and the brainstorm. I am out for some hints to solve this problem and i will let you know if i have some solution.
    Markus

    P.S.: More suggestions from anybody are welcome …

    Ninja Lead Moderator
    #463341

    I think you can not change on the code php file.

    Open templates/ja_wall/css/template.css file

    .item-hot .header h2:before {
    background: #c00
    color: #fff
    content: "HOT";
    display: block; /* cannot use "inline" or "inline-block" 'cause bad character */
    font-size: 10px;
    line-height: normal;
    padding: 2px 0;
    text-align: center;
    border-radius: 3px;
    position: absolute;
    left: 0;
    top: 2px;
    width: 40px;
    text-indent: 0;
    }

    find and change anything if you like it

    <blockquote>content: “HOT”;</blockquote>

    Configuration to show Hot icon on JA Wall Template: http://easycaptures.com/fs/uploaded/619/2826568308.png

Viewing 4 posts - 1 through 4 (of 4 total)

This topic contains 4 replies, has 3 voices, and was last updated by  Ninja Lead 12 years, 4 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum