Keyword

Create another "feature" class

  • Julien Deshayes
  • Julien Deshayes's Avatar Topic Author
  • Offline
  • New Member
More
12 years 11 months ago #58095 by Julien Deshayes
Create another "feature" class was created by Julien Deshayes
Based on the look of "featured" I would need to create 2 more style
for some articles

how could I achieve this : the checkbox for the "feature" or "top" or "news" selection, and the css style when page displays item.

thx for the help

Please Log in or Create an account to join the conversation.

More
12 years 11 months ago - 12 years 11 months ago #58096 by SDKiller
Replied by SDKiller on topic Re: Create another "feature" class
I suppose you can make it using extrafields. Create extrafield for that purpose, assign it corresponding value and add condition in your item layout to check it and assign css class to item elements.

Or you can create a plugin to add tab in your item edit form and operate item params. And when displaying item - use plugin events to parse these params and assign css class.

Russian K2 support on joomlaforum.ru

Please Log in or Create an account to join the conversation.

More
12 years 11 months ago - 12 years 11 months ago #58097 by Mihail Semerdzhiev
Replied by Mihail Semerdzhiev on topic Re: Create another "feature" class
Use this code to use K2 extra fields:
[code type=php-brief]
<?php $f=null;
foreach($this->item->extra_fields as $f){
if($f->id == 3) break; //id of the extra field
}
if($f->id && in_array(strtolower($f->value),array('female','male','unisex'))){ //values insterted in the extra field
$class = strtolower($f->value);
?>
<div class='<?php echo $class; ?>' style='position:absolute; top:1px; right:1px; z-index:100;'>
<img src='<?php echo $class.".png"; ?>' />
</div>
<?php } ?>[/code]

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum