w3tweaks
  • Effects
    • Scroll Effects
    • Text Effects
    • Shadow
  • Essentials
    • Arrows
    • Buttons
    • Background Patterns
    • Border Examples
    • Cards
    • Color Palettes
    • Dividers
    • Link styles
    • Loaders
    • Modal Windows
    • Notifications
    • Progress bar
    • Quote styles
    • Spinner
    • Tooltips
  • Media
    • Calendars
    • Carousels
    • Clocks
    • Gallery
    • Music Players
    • Sliders
    • Slideshows
    • Tables
    • Thumbnails
  • Navigation
  • Inputs
    • Range Sliders
    • Checkboxes
    • Toggle Switches
  • Scripts
    • Angularjs
    • Backbone.js
    • bootstrap
    • jQuery
    • ReactJs
    • JavaScript
    • Syntax Highlighters
    • tryit editor
    • PHP
  • API’s
    • Facebook
    • Google
    • Indeed
    • Twitter
    • YouTube
w3tweaks
  • Effects
    • Scroll Effects
    • Text Effects
    • Shadow
  • Essentials
    • Arrows
    • Buttons
    • Background Patterns
    • Border Examples
    • Cards
    • Color Palettes
    • Dividers
    • Link styles
    • Loaders
    • Modal Windows
    • Notifications
    • Progress bar
    • Quote styles
    • Spinner
    • Tooltips
  • Media
    • Calendars
    • Carousels
    • Clocks
    • Gallery
    • Music Players
    • Sliders
    • Slideshows
    • Tables
    • Thumbnails
  • Navigation
  • Inputs
    • Range Sliders
    • Checkboxes
    • Toggle Switches
  • Scripts
    • Angularjs
    • Backbone.js
    • bootstrap
    • jQuery
    • ReactJs
    • JavaScript
    • Syntax Highlighters
    • tryit editor
    • PHP
  • API’s
    • Facebook
    • Google
    • Indeed
    • Twitter
    • YouTube
w3tweaks
Home CMS
How to import joomla modules inside any custom components

How to import joomla modules inside any custom components

W3TWEAKS by W3TWEAKS
August 16, 2019
in CMS
0

This tutorial will explain how to import joomla modules inside custom components like plugin, module or components. In this tutorial sample code and demo is available.

You might also like

PHP Content Management Systems

8 PHP Content Management Systems (CMS)

May 9, 2020
0
Add custom attribute in Joomla 3.x addScript

Add custom attribute in Joomla 3.x addScript

August 16, 2019
0

Before starting the tutorial you have to create one position for your module.

Import Joomla helper in your custom component

First step import the module helper function. find the code below.

[ads1]

jimport('joomla.application.module.helper');

Once you imported the above code call your position to include all the mapped modules to display inside custom components. Find the code below.

$modules = JModuleHelper::getModules('relatedArticles'); foreach($modules as $module) {
     echo  "<h3>".$module->title."</h3>"; 
     echo JModuleHelper::renderModule($module);
}

In the above code you can find the position name “relatedArticles” which is the position I want to add below my article and you can find below with the name “Related Posts You May Like…”

foreach will loop what ever module linked with “relatedArticles” position.

Same you can add you position name and enjoy seeing your modules in any ware you want to place like plugin, components and etc inside Joomla project.

Tags: componentsimportinsideJoomlamoduleplugins
Previous Post

Enable and Disable drop down box using angularjs ngDisabled

Next Post

Iterate javascript object keys using angularjs ngRepeat

W3TWEAKS

W3TWEAKS

Since I've had a strong background in front-end development, I took the initiative to start my own website (w3tweaks.com) to share my knowledge with the world.

Related Stories

PHP Content Management Systems

8 PHP Content Management Systems (CMS)

by W3TWEAKS
May 9, 2020
0
0

Find the collection of PHP Content Management Systems. Back Drop CMS The free and Open Source CMS that helps you...

Add custom attribute in Joomla 3.x addScript

Add custom attribute in Joomla 3.x addScript

by W3TWEAKS
August 16, 2019
0
0

This tutorial will explain you, how add custom attributes in Joomla 3.x addScript() Find the code below $doc = JFactory::getDocument();...

Joomla 3 – Page Navigation With Titles

Joomla 3 – Page Navigation With Titles

by W3TWEAKS
August 16, 2019
0
0

In this tutorial you will learn how to set the article title for page navigation buttons You will be seeing...

Joomla 3 – Refresh Manifest Cache failed: Extension is not currently installed

Joomla 3 – Refresh Manifest Cache failed: Extension is not currently installed

by W3TWEAKS
August 16, 2019
0
0

In this tutorial we will show you how to fix the "Refresh Manifest Cache failed" error in Joomla! You may...

Next Post
Iterate javascript object keys using angularjs ngRepeat

Iterate javascript object keys using angularjs ngRepeat

Discussion about this post

We bring you the best frontend collections that will fix perfect for news, magazine, personal blog, etc. Check our landing page for details.

  • Effects
    • Scroll Effects
    • Text Effects
    • Shadow
  • Essentials
    • Arrows
    • Buttons
    • Background Patterns
    • Border Examples
    • Cards
    • Color Palettes
    • Dividers
    • Link styles
    • Loaders
    • Modal Windows
    • Notifications
    • Progress bar
    • Quote styles
    • Spinner
    • Tooltips
  • Media
    • Calendars
    • Carousels
    • Clocks
    • Gallery
    • Music Players
    • Sliders
    • Slideshows
    • Tables
    • Thumbnails
  • Navigation
  • Inputs
    • Range Sliders
    • Checkboxes
    • Toggle Switches
  • Scripts
    • Angularjs
    • Backbone.js
    • bootstrap
    • jQuery
    • ReactJs
    • JavaScript
    • Syntax Highlighters
    • tryit editor
    • PHP
  • API’s
    • Facebook
    • Google
    • Indeed
    • Twitter
    • YouTube