-
AuthorPosts
-
markkusq3po Friend
markkusq3po
- Join date:
- March 2007
- Posts:
- 66
- Downloads:
- 0
- Uploads:
- 6
- Thanks:
- 20
- Thanked:
- 1 times in 1 posts
August 4, 2012 at 11:46 am #179647Hello, 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 Markusarucardx Friendarucardx
- Join date:
- July 2010
- Posts:
- 346
- Downloads:
- 0
- Uploads:
- 10
- Thanks:
- 21
- Thanked:
- 138 times in 104 posts
August 4, 2012 at 2:56 pm #463169I 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
1 user says Thank You to arucardx for this useful post
markkusq3po Friendmarkkusq3po
- Join date:
- March 2007
- Posts:
- 66
- Downloads:
- 0
- Uploads:
- 6
- Thanks:
- 20
- Thanked:
- 1 times in 1 posts
August 4, 2012 at 5:05 pm #463173Hi, 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.
MarkusP.S.: More suggestions from anybody are welcome …
Ninja Lead ModeratorNinja Lead
- Join date:
- November 2014
- Posts:
- 16064
- Downloads:
- 310
- Uploads:
- 2864
- Thanks:
- 341
- Thanked:
- 3854 times in 3563 posts
August 6, 2012 at 9:28 am #463341I 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
-
AuthorPosts
This topic contains 4 replies, has 3 voices, and was last updated by Ninja Lead 12 years, 3 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum