Skip to content

Instantly share code, notes, and snippets.

@smaida
Created September 18, 2011 03:23
Show Gist options
  • Save smaida/1224686 to your computer and use it in GitHub Desktop.
Save smaida/1224686 to your computer and use it in GitHub Desktop.
Parse Tags to Solspace Tag Module (Used when parsing entries with the ExpressionEngine Channel Entries API)
// Module code
// I(is_file(PATH_THIRD.'tag/mod.tag'.EXT) && count($tags) > 0)
{
require_once PATH_THIRD.'tag/mod.tag'.EXT;
$TAG = new Tag();
$TAG->channel_id = $this->channel_id;
$TAG->site_id = $this->site_id;
$TAG->entry_id = $this->EE->api_channel_entries->entry_id;
$TAG->str = trim(implode(',' , $tags));
$TAG->type = 'channel';
$TAG->parse();
}
// Template code
// All params / tags from the Solspace Related Entries tag are available (http://www.solspace.com/docs/detail/tag_related_entries/)
{exp:custom_module_name:related_entries
disable="member_data|trackbacks"
dynamic="no"
channel="twitter|videos|papers|blog"
limit="20"
orderby="entry_date"
paginate="bottom"
entry_id="{embed:entry_id}"}
{/exp:custom_module_name:related_entries}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment