Keyword

How to cancel image re-sizing?

More
7 years 7 months ago #157861 by Maria
Replied by Maria on topic How to cancel image re-sizing?
No, I don't use tags, user pages and K2's search listings.

Are we talking about these two files?

1.) components/com_k2/templates/default/item.php

2.) templates/jp-x2/html/com_k2/templates/default/item.php

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 7 months ago - 7 years 7 months ago #157875 by Krikor Boghossian
Replied by Krikor Boghossian on topic How to cancel image re-sizing?
The latter.
Make sure to replace the demo alias with the extrafield's actual alias.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Last edit: 7 years 7 months ago by Krikor Boghossian.

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

More
7 years 7 months ago #157894 by Maria
Replied by Maria on topic How to cancel image re-sizing?
Okay, so this code:
// Use an extrafield instead of K2's images - The extrafield is an IMAGE one
<?php if( $this->item->params->get('itemImage') && $this->item->extraFields->EXTRAFIELDALIASHERE->value !== '' ):
	$var = $this->item->extraFields->EXTRAFIELDALIASHERE->value ;     
	$var = preg_replace('/<img src="/',"",$var); 
	$var = preg_replace('/"> alt="Image" \>/'," ",$var); ?>

	<img src="<?php echo $var; ?>" alt="<?php if(!empty($this->item->image_caption)) echo K2HelperUtilities::cleanHtml($this->item->image_caption); else echo K2HelperUtilities::cleanHtml($this->item->title); ?>" style="width:<?php echo $this->item->imageWidth; ?>px; height:auto;" />

<?php endif; ?>

should be added to this file:
templates/jp-x2/html/com_k2/templates/default/item.php Correct?

And also to replace the demo alias with the extrafield's actual alias. Could you tell me how it could be done or at least please provide a link to where I could learn more about it, 'cos I have no clue, frankly.

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 7 months ago #157906 by Krikor Boghossian
Replied by Krikor Boghossian on topic How to cancel image re-sizing?
This is a semi-complex procedure which alter K2's core functionality.
It requires familiarity with coding and K2 knowledge as well.

You need to set extrafields name them properly (check the alias field) and apply the code in your template. The exact place should be provided from the template developer.

Furthermore you will need to reupload these images.

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

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

More
7 years 7 months ago #157911 by Maria
Replied by Maria on topic How to cancel image re-sizing?
Thanks for your reply!

I understand that I'm gonna need a PHP developer to do that. The reason why I'm asking is because at very least I want to have a clue what to ask from them. Like okay, here's the file and here's the code that should be altered. But if I just have a vague general request, they might not even know what to do. I kinda asked two questions in my previous post and you answered my second one, so let me ask you the first one here again.
So that piece of code should be inserted with alterations that you told me about (the semi-complex ones) into that file, correct?

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 7 months ago #157920 by Krikor Boghossian
Replied by Krikor Boghossian on topic How to cancel image re-sizing?

So that piece of code should be inserted with alterations that you told me about (the semi-complex ones) into that file, correct?


Yes, minimal alterations, eg: CSS classes and the extrafield's alias but alterations, none the less.

You can ask the template's developer for assistance, since they will have in-depth knowledge about the specifics.

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

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

More
7 years 7 months ago #157927 by Maria
Replied by Maria on topic How to cancel image re-sizing?
Okay, great!
Thanks a lot for your explanation.

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 7 months ago #157933 by Krikor Boghossian
Replied by Krikor Boghossian on topic How to cancel image re-sizing?
You 're welcome Maria :)

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

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


Powered by Kunena Forum