Keyword

How to add a subCategory image width parameter in K2 v.2.2

  • Arnold Wender
  • Arnold Wender's Avatar Topic Author
  • Offline
  • New Member
More
14 years 10 months ago #77894 by Arnold Wender
Hello,If you need to specify for any reason a different width for subCategories replace this files:administrator/components/com_k2/lib/config.xmlcomponents/com_k2/templates/default/category.phpwith the attached onesor follow this steps:Navigate to administrator/components/com_k2/lib/ and edit the file config.xmlAdd this new parameter after the line 19 (that would be the parameter catImageWidth):<param menu="hide" name="subcatImageWidth" type="text" default="50" size="4" label="subCategory image width (in px)" description="" />Then navigate to your K2 template normally components/com_k2/templates/default and edit the file category.phpAdd the style attribute to the SubCategoryImage that´s on the line 19:          <a class="subCategoryImage" href="<?php echo $subCategory->link; ?>"> <img alt="<?php echo $subCategory->name; ?>" src="<?php echo $subCategory->image; ?>" style="width:<?php echo $this->params->get('subcatImageWidth'); ?>px; height:auto;" /> </a>Save files and test it.let me know if this was helpful to youArnoldP.S. Hope you understand my Englsih :D

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


Powered by Kunena Forum