running joomla content plugins in my module - Joomla! Forum - community, help and support


hi trying run joomla content plugin in module no success far

this code

code: select all

<?php
defined( '_jexec' ) or die;


 jpluginhelper::importplugin('content');
   $module->stendas_description = jhtml::_('content.prepare', $module->stendas_description, '', 'mod_stendulist.content');
   


$db = jfactory::getdbo();

$query = $db->getquery(true);

$query->select('stendas_id, stendas_lat, stendas_lon, stendas_name, stendas_description, stendas_kaire, stendas_desine')
      ->from('#__stendukai_stendai')
      ->where('published = 1');

$db->setquery($query);

$rows = $db->loadobjectlist();


require jmodulehelper::getlayoutpath('mod_stendulist', $params->get('layout', 'default'));




i copied code custom module, not work me, please :)

i'm not sure you're trying do, whole point of plugins don't need explicity run them. meaning, joomla provides different plugins each set of methods hook automate variety of process. joomla content plugin have these methods:

onbeforecontentsave
onaftercontentsave
onpreparecontent
onafterdisplaytitle
onbeforedisplaycontent
onafterdisplaycontent

so, depending on , trying accomplish plugin, hook of these methods, provide referenced variables active article, params , content add/subtract pass edited variable framework rendering.

in scenario depends on trying accomplish determine if plugin or incorporating additional logic module file best course of action.

below link creating content plugin documentation, again, wonder if plugin best approach here.

http://docs.joomla.org/creating_a_content_plugin





Comments

Popular posts from this blog

How to change text Component easybook reloaded *newbee* - Joomla! Forum - community, help and support

After Effect warning: A problem occurred when processing OpenGL commands

Preconditions Failed. - Joomla! Forum - community, help and support