1
votes

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.

1
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 JoomlaLodder
By custom page I mean an Alternate Layout for an article. I copied the Default.php file and edited to my liking.DeanPeters

1 Answers

0
votes

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