Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » MetaMod
- » MetaMod General Support
- » Recipe for K2 Attachments
Recipe for K2 Attachments
Recipe for K2 Attachments
I am trying to combine show a module with K2 attachment links in the sidebar of my blog on every K2 Item that HAS an attachment. Regularly, the module would show on every K2 Item regardless of whether there was an attachment associated with the displayed Item.
Theoretically, this should be possible using metamod, which I've used successfully for other purposes. Does anyone know the proper syntax for referencing K2 attachments???
Re: Recipe for K2 Attachments
Re: Recipe for K2 Attachments
On J2.5, try it this way:
if (
$option == 'com_k2'
and $view == 'item'
) {
$newid = (int)$id;
$query = 'select itemID from #';
$query .= '__k2_attachments where itemId = ' . $newid;
$db->setQuery($query);
$result = $db->loadResult();
if ($result) return XXX;
// replace XXX with the module ID of the K2 content module.
// the target module will only show if you are on a K2 item view
// page for an item with an attachment on it.
}
- Index
- » MetaMod
- » MetaMod General Support
- » Recipe for K2 Attachments
Board Info
- Board Stats:
- Total Topics:
- 1689
- Total Polls:
- 6
- Total Posts:
- 5942
- Posts this week:
- 2
- User Info:
- Total Users:
- 7629
- Newest User:
- claudiabush9
- Members Online:
- 1
- Guests Online:
- 112
- Online:
- claudiabush9
Forum Legend:
Topic
New
Locked
Sticky
Active
New/Active
New/Locked
New Sticky
Locked/Active
Active/Sticky
Sticky/Locked
Sticky/Active/Locked