我有一個自定義的Html模塊,我需要在組件視圖中顯示。如何獲取Custom Html並在組件視圖中顯示它。如何在joomla組件中渲染自定義Html模塊
jimport('joomla.application.module.helper');
// this is where you want to load your module position
$modules = JModuleHelper::getModules('custom');
foreach($modules as $module)
{
echo JModuleHelper::renderModule($module);
}
試過上面的代碼..但沒有得到它。 需要解決這個問題。
感謝您的回覆,jimport('joomla.application.module.helper'); $ module = JModuleHelper :: getModule('mod_custom','social-media'); echo JModuleHelper :: renderModule($ module); – user3045790
如果它對你有用,那麼將其標記爲答案,以便它也可以幫助其他人。 –
在這裏有一個問題... jimport('joomla.application.module.helper'); $ module = JModuleHelper :: getModule('mod_custom','social-media'); echo JModuleHelper :: renderModule($ module); 它適用於標題=(社交媒體)的上述代碼。 它也適用於標題=(瞭解更多)的代碼。 但它不適用於標題=(家庭視頻)其他自定義模塊 $ module = JModuleHelper :: getModule('mod_custom','Home Video'); 請幫我解決這個問題。 – user3045790