簡體   English   中英

如何從Joomla中獲取和回顯“替代布局”值! index.php中的MENU模塊(模板)?

[英]How to get and echo the “Alternative Layout” value from the Joomla! MENU module in index.php (template)?

我需要為我的MENU模塊獲取“ Alternative Layout”的值:

例:

備用布局= layout1

我需要在模板文件(index.php)中回顯值“ layout1”

這可能嗎? 提前致謝。

您必須添加到模板中的代碼是:

<?php
        jimport( 'joomla.application.module.helper' );
        $module = JModuleHelper::getModule( 'menu', 'Footer menu' );

        $moduleParams = new JRegistry();
        $moduleParams->loadString($module->params);
        $layout = $moduleParams->get('layout');
        echo $layout;
?>

您必須在以下位置設置模塊的類型和標題:

getModule('menu','Footer menu');

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM