1

I created a component in my Joomla website theme folder, like so:

/templates/rt_afterburner/html/com_content/article

By custom page, I mean an Alternate Layout for an article. I copied the Default.php file and edited it.

Then I created a php file and that is all working correctly.

I am trying to get this "latest news" module from the homepage on my page but I am not sure what I have to call to render this.

<div id="latestnews" class="highlightblock single"><jdoc:include type="modules" name="fp_latestnews" style="xhtml" /></div>

I have tried coping over the module files to where my php file is and included:

$app = JFactory::getApplication(); 

But I can't seem to get this to work.

Christian Gollhardt
  • 16,510
  • 17
  • 74
  • 111
DeanPeters
  • 11
  • 2
  • I'm a little confused. You created a template override for the **com_content** and then go on to mention the latest news module? Copying an extension into your template folder is called a Template Override which allows you to edit the view for the extension. It has nothing to do with which pages it gets rendered on. When you also say "Custom page"...what do you mean by this? If it's a separate PHP that's not related to Joomla, then please **do not** do this. Joomla is a CMS and runs on extensions. If you want standalone pages then don't use Joomla – Lodder Feb 05 '15 at 11:59
  • By custom page I mean an Alternate Layout for an article. I copied the Default.php file and edited to my liking. – DeanPeters Feb 05 '15 at 12:21

1 Answers1

0

You could load a module in a layout override file using JModuleHelper/renderModule method.

jimport( 'joomla.application.module.helper' );
$module = JModuleHelper::getModule( 'mainmenu', 'Key Concepts' );
$attribs['style'] = 'xhtml';
echo JModuleHelper::renderModule( $module, $attribs );

Reference: JModuleHelper/renderModule

emmanuel
  • 9,607
  • 10
  • 25
  • 38