- Posts: 1
COMMUNITY FORUM
K2mart generic.php
- Jose Pedro Valiente Martin
-
Topic Author
- Offline
- New Member
Less
More
14 years 3 months ago #92449
by Jose Pedro Valiente Martin
K2mart generic.php was created by Jose Pedro Valiente Martin
HelloHow are you?First, I want to thank you for your advice and tutorials k2.But I have a problem, I am not able to solve.I bought the plugin k2mart, and I want to appear in the search plugin.I've done everything that is posted on the forums.Like, "Hi. plugins K2 Are Not Been Executed in generic listings, that's why K2mart not does show up on search results. If You Need You Can Implement this feature it in yourtemplate file (generic.php). To Achieve this put the Following code Just Before theforeach loop:Code:<? php $ dispatcher = & JDispatcher:: getInstance (); JPluginHelper: importPlugin('k2', 'k2mart');?>After That You Will Also Need to put the Following code inside the foreach loop:Code:<? php$ results = $ dispatcher-> trigger ('onK2AfterDisplayContent', array (& $ item, $ item-> params, 0));$ item-> event-> onK2AfterDisplayContent = trim (implode ("\ n ", $ results));echo $ item-> event-> onK2AfterDisplayContent;?>But not solved, I am not able to appear.And on generic.php the css used is the one in the joomla component not in thecomponent template is normal.First of all, thank you.Jose Pedro.ps: attached generic.php
Please Log in or Create an account to join the conversation.
- matthew turner
-
- Offline
- Senior Member
Less
More
- Posts: 66
14 years 1 month ago #92450
by matthew turner
Replied by matthew turner on topic K2mart generic.php
Hi,
Just noticed you had quite a few errors in the code above (spaces where there should be none, single colon where there should be 2 ::) - I have corrected it and tested working in the tags page (generic.php):
<?php
$dispatcher = &JDispatcher:: getInstance (); JPluginHelper:: importPlugin('k2', 'k2mart');
?> <?php foreach($this->items as $item): ?><?php$results = $dispatcher->trigger('onK2AfterDisplayContent', array (&$item, $item->params, 0));$item->event->onK2AfterDisplayContent = trim(implode ("\n", $results));echo $item->event->onK2AfterDisplayContent;?>
Regards
Mat
Just noticed you had quite a few errors in the code above (spaces where there should be none, single colon where there should be 2 ::) - I have corrected it and tested working in the tags page (generic.php):
<?php
$dispatcher = &JDispatcher:: getInstance (); JPluginHelper:: importPlugin('k2', 'k2mart');
?> <?php foreach($this->items as $item): ?><?php$results = $dispatcher->trigger('onK2AfterDisplayContent', array (&$item, $item->params, 0));$item->event->onK2AfterDisplayContent = trim(implode ("\n", $results));echo $item->event->onK2AfterDisplayContent;?>
Regards
Mat
Please Log in or Create an account to join the conversation.
- Evert Bal
-
- Offline
- New Member
Less
More
- Posts: 6
13 years 10 months ago #92451
by Evert Bal
Replied by Evert Bal on topic K2mart generic.php
Hello,
This solution works fine, until php 5.3 comes up.
Does anyone knows how to fix that?
This solution works fine, until php 5.3 comes up.
Does anyone knows how to fix that?
Please Log in or Create an account to join the conversation.