To show categorized content, you need templates that get loaded at category URL’s. The channel entries tags on those templates will self-filter when loaded at a category url.
See this tutorial for working with one template that is loaded with and without category urls.
Can I create a hook on call {exp:channel:entries}? And then modify the contents of the tag {exp:channel:entries} If yes - tell me, please, as it is being implemented.
For example - I intercept call of {exp:channel:entries channel="channel1"} and modify it to {exp:channel:entries channel="channel2"} ?
Thanks a lot.
Good day. I try get tagdata from {exp:channel:entries ….} and modify it. For example - in template I call {exp:channel:entries channel="channel1" limit="5"}, but in extension I modify call to {exp:channel:entries channel="channel1" limit="10"} I try to use http://eeclub.ru/docs2/development/extension_hooks/module/channel/index.html#channel_entries_tagdata For test I create extension which write to file tagdata, like
function activate_extension()
{
$data = array(
'class' => __CLASS__,
'method' => 'modifyExpChannelTag',
'hook' => 'channel_entries_tagdata',
'settings' => serialize($this->settings),
'priority' => 10,
'version' => $this->version,
'enabled' => 'y'
);
$this->EE->db->insert('extensions', $data);
}
function disable_extension()
{
$this->EE->db->where('class', __CLASS__);
$this->EE->db->delete('extensions');
}
function modifyExpChannelTag($param1, $param2)
{
$fh = fopen("c:\\test.txt", "a+"); // I'm use windows
fwrite($fh, var_export($param1,true));
fclose($fh);
return $param1;
}In file I expect to see - {exp:channel:entries channel="channel1" limit="5"}, but I see another information (like as parsed page) Where is my mistake ?
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.