Keyword

Get specific image size from main parameters

  • Nick
  • Nick's Avatar Topic Author
  • Offline
  • Elite Member
More
12 years 3 months ago #67447 by Nick
I'm trying to force a certain width to my images (don't ask why, long story) so I need to get the medium image width parameter which is set in the back-end. How do i do that? I tried (in the template file of k2_content) $params->get('itemImageM') but that returns nothing. ItemImgSize returns Medium (that's what its set to in the module.

I SPECIFICALLY NEED to force the width set in the admin area. (the cached images are different size)

Right now i'll just force the value manually in the html.

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

  • Nick
  • Nick's Avatar Topic Author
  • Offline
  • Elite Member
More
12 years 3 months ago #67448 by Nick
bamp

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

More
12 years 3 months ago #67449 by Lefteris
Hi. It depends on the context. Generally using :

$params = JComponentHelper::getParams('com_k2');
$params->get('itemImageM');

will give you what you want. Note that this will give you the setting in the global K2 parameters. If you have overriden those settings in a category it's a different story.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

  • Nick
  • Nick's Avatar Topic Author
  • Offline
  • Elite Member
More
12 years 3 months ago #67450 by Nick
I'll try it out tomorrow (uber late here now).

I forgot to mention the context. I'm doing this in the view (mod_k2_content).

fingers crossed :D :silly:

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


Powered by Kunena Forum