Giorgi625 VIP
Total posts: 655
21 Jan 2016 17:08

Is there any posibility to display article participants module content as a field? I mean I need to display it in cobalt record template, not on Joomla tempalte module position. how I guess I can use html field and modules anywhere or some plugin like this, but is there any native function to do this job?

Last Modified: 20 Apr 2017


pepperstreet VIP
Total posts: 3,837
21 Jan 2016 23:38

Giorgi625 I guess I can use html field

Hello Giorgi625, you have different options to load a module/module-position. You could use a Cobalt HTML or TextArea field. Both supply parameters to "Prepare Content" i.e. to run content plugins
You could disable all unwanted features, and fill the "default value" with the Joomla core plugin syntax:
See documentation link for all options. If you just have 1 specific Module, you could use the very basic call like this:

/*remove leading and trailing spaces!*/
{ loadmodule YourModuleName }
Little Headsup

Dis-advantage: This would save the syntax and data for each record! If you want to change something later on, you would have to change all related records/values. Also remember to set correct Access in field parameters. Submission and Edit should be done by Special users only.

Small benefit: If you use the Cobalt default templates and "field output loop", you can re-arrange the order and position through the usual field ordering.

and modules anywhere or some plugin like this, but is there any native function to do this job?

A better and cleaner solution is to load your module/module-position in your cobalt template.
Make a copy of your current Record fullview template.
Use native Joomla functions and PHP code like these:

load 1 specific module by type & name (optional)
Set module chrome style in attributes (optional)

<?php
jimport( 'joomla.application.module.helper' );
$module = JModuleHelper::getModule( 'cobalt_participants', 'My Module Title' );
$attribs['style'] = 'xhtml';
echo JModuleHelper::renderModule( $module, $attribs );
?>

or alternatively...

load a complete custom module-position

<?php
jimport('joomla.application.module.helper');
$modules = JModuleHelper::getModules('my-position');
foreach($modules as $module)
{
    echo JModuleHelper::renderModule($module);
}
?>

Hope this helps.


Giorgi625 VIP
Total posts: 655
20 Apr 2017 18:31

No at that time I had no time for that project and postponed it,

it's a shame but now I even don't remember why I needed this feature. :D


pepperstreet VIP
Total posts: 3,837
20 Apr 2017 22:24

Haha, no problem! ;)
I like the idea and could even imagine the functionality in Records field.
Or as a separate one. Although it might have an impact on performance on every full record view?! Not sure if the module version is a better choice... it fires SQL queries anyway. Maybe if it does support J! "module cache"!?

Powered by Cobalt