Keyword

Custom K2 Content Module Assistance

  • Joe Campbell
  • Joe Campbell's Avatar Topic Author
  • Offline
  • Platinum Member
More
7 years 7 months ago #157684 by Joe Campbell
Replied by Joe Campbell on topic Custom K2 Content Module Assistance
Cool - would there be any performance benefits to using such a module vs. using the code you provided to override the K2 Content Module?

Offering the free module is nice gesture.

You could also use it as a new feature to round out the official 2.7.1 release.

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 #157685 by Krikor Boghossian
Replied by Krikor Boghossian on topic Custom K2 Content Module Assistance
It is exactly the same, the module is a cleaner solution with more options.

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

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

  • Joe Campbell
  • Joe Campbell's Avatar Topic Author
  • Offline
  • Platinum Member
More
7 years 7 months ago #157686 by Joe Campbell
Replied by Joe Campbell on topic Custom K2 Content Module Assistance
Understood - thanks

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

  • Fábio Jordan
  • Fábio Jordan's Avatar
  • Offline
  • Senior Member
  • Nothing like a good coffee to make a better web
More
7 years 7 months ago #157687 by Fábio Jordan
Replied by Fábio Jordan on topic Custom K2 Content Module Assistance
Very cool, Krikor! That module would be very nice to replace BNR.

Joe Campbell, the twitter of my website is @cafecomfilme and there's no company, I'm the owner, so my profile is @FabioMJordan

Thanks for the compliment.

Regards

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

  • Mohamed Abdelaziz
  • Mohamed Abdelaziz's Avatar
  • Offline
  • Platinum Member
  • Joomla Developer
More
7 years 7 months ago #157699 by Mohamed Abdelaziz
Replied by Mohamed Abdelaziz on topic Custom K2 Content Module Assistance
I have found a solution of a simple hack, just to keep the functionality of the K2 Content Module as it is, and add to it this new feature.

The first step is to add a switch parameter to enable/disable this feature, by editing the mod_k2_content.xml file, insert these lines:
<field name="K2AutoDetectItem" type="radio" default="0" label="Auto Detect Current Item" description="">
        <option value="0">K2_NO</option>
         <option value="1">K2_YES</option>
</field>

After this line:
<field name="" type="header" default="K2_SELECT_SPECIFIC_ITEMS" label="" description=""/>

Then edit helper.php file, replace this line:
$value = $params->get('items');

with these lines:
$jinput = JFactory::getApplication()->input;
if($params->get('K2AutoDetectItem') && $jinput->get('view')=='item'){
		$value = strval(intval($jinput->get('id')));				
} else {
		$value = $params->get('items');
}

This way you can keep the module working as normal, and you can add this feature to the module instances you need by setting the Auto Detect Current Item parameter to Yes

That's just my 2 cents in this subject.

Multiple Extra Fields Groups for K2
AutoMeta for K2
Chained Fields for K2
More K2 Extensions In My Extensions Store

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

  • Joe Campbell
  • Joe Campbell's Avatar Topic Author
  • Offline
  • Platinum Member
More
7 years 7 months ago #157700 by Joe Campbell
Replied by Joe Campbell on topic Custom K2 Content Module Assistance
Nice solition @MohamedAbdelaziz

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 #157712 by Krikor Boghossian
Replied by Krikor Boghossian on topic Custom K2 Content Module Assistance
@MohamedAbdelaziz A PR is always welcome ;)

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

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

  • Mohamed Abdelaziz
  • Mohamed Abdelaziz's Avatar
  • Offline
  • Platinum Member
  • Joomla Developer
More
7 years 7 months ago #157739 by Mohamed Abdelaziz
Replied by Mohamed Abdelaziz on topic Custom K2 Content Module Assistance
Ok @Krikor :)
Will do.

Multiple Extra Fields Groups for K2
AutoMeta for K2
Chained Fields for K2
More K2 Extensions In My Extensions Store

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 #157765 by Krikor Boghossian
Replied by Krikor Boghossian on topic Custom K2 Content Module Assistance
Thanks mate :)

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