How I can get params from joomla menu

Written by  Thursday, 28 April 2016 16:31
$menu	=  JSite::getMenu();
$item    =  $menu->getActive();

$params	= $menu->getParams($item->id);

$your-id = $params->get('params_name', 0);

 

365 Read Last modified on Thursday, 28 April 2016

Related items

  • [solved] Deprecated: Methods with the same name as their class will not be constructors ... www/plugins/content/jw_sigpro/jw_sigpro.php on line 19

    If you update your hosting to v7.1 & more - you can look same notification 'Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; plgContentJw_sigpro has a deprecated constructor in .../www/plugins/content/jw_sigpro/jw_sigpro.php on line 19'

    This code fix this problem you need Open plugins/content/jw_sigpro/jw_sigpro.php find this code in line 28:

    function plgContentJw_sigpro(&$subject, $params)
    	{
    		parent::__construct($subject, $params);
    
    		// Define the DS constant under Joomla! 3.0
    		if (!defined('DS'))
    		{
    			define('DS', DIRECTORY_SEPARATOR);
    		}
    	}

     And replase it to this code:

    public function __construct(&$subject, $params) {
    	parent::__construct($subject, $params);
    
    	// Define the DS constant under Joomla! 3.8.2+
    	if (!defined('DS')){
    		define('DS', DIRECTORY_SEPARATOR);
    	}
    }

    Awesome - it work done! :-)

    If you see same problem with jw_sig.php  - just download free new plugin from GitHub and install it: https://github.com/joomlaworks/simple-image-gallery

  • 7 tips to improve Joomla website performance [part 2]

    To continue with the tips to improve Joomla website performance, in the previous part, I had introduced how to use caching and .htaccess Optimization Rules, in this part, I will show you some other tips and hope you find it useful.

    Joomla Compression

    This is also an effective feature to optimize your website performance. When you enable this feature, the web page will be compressed and of course, the compressed page will take less time to load. Here is the way to enable Joomla Compression:

  • 7 tips to improve Joomla website performance [part 1]

    If you want to check the speed of your Joomla website, let’s start with speed test first. It can be said that site speed is one of the most important factors that affect directly a site performance. All your effort put into user-friendly interface, conversion rate optimization, high-quality content, and other things will not make sense if your page takes visitors too much time for loading.

    Of course, I do not deny that Joomla is one of the most powerful CMS and the best choice for any business owners who want to have websites easily but it had better improve your site speed continuously. You can increase the speed of your Joomla site by using its inbuilt features and follow the tips I will mention in this article.

  • Joomla! 4 – The hope of promising year 2018

    During 2017, we have heard a lot of opinions that this year has been too gloomy for Joomla. However, we think that this year is so important because it is the stepping stone for the explosion in 2018 when we prepare to welcome Joomla! 4.0 and Joomla! Framework 2.0. In addition to introducing several new features, including a fully rebuilt Media Manager, an enhanced event dispatching system, and new security features such as support for prepared SQL statements, we have also been doing some routine maintenance and paying off some of our project’s technical debt by retiring deprecated code and raising the minimum supported software stack. And, with this released version, we also require PHP 7.

  • Unset Joomla Scripts from Template (k2 and other)
    in PHP
    // Unset unwanted Scripts - by name
    $unset_scripts = array(
    	'k2',
    	'...',
    );
    
    foreach($this->_scripts as $name=>$script)
    {
    	if (!preg_match('#(' . implode('|', $unset_scripts) . '#i', $name))
    	{
    		continue;
    	}
    
    	unset($this->_scripts[$name]);
    }

    or if you use joomla v3.8.1 you can try this php code:

    <?php
    	$doc = JFactory::getDocument();
    	unset($doc->_scripts[JURI::root(true) . '/media/system/js/mootools-more.js']);
    	unset($doc->_scripts[JURI::root(true) . '/media/system/js/mootools-core.js']);
    	unset($doc->_scripts[JURI::root(true) . '/media/system/js/core.js']);
    	unset($doc->_scripts[JURI::root(true) . '/media/system/js/modal.js']);
    	unset($doc->_scripts[JURI::root(true) . '/media/system/js/caption.js']);
    	unset($doc->_scripts[JURI::root(true) . '/media/jui/js/jquery.min.js']);
    	unset($doc->_scripts[JURI::root(true) . '/media/jui/js/jquery-noconflict.js']);
    	unset($doc->_scripts[JURI::root(true) . '/media/jui/js/bootstrap.min.js']);
    ?>

    if you wand disable all js & css scripts - use code:

    $doc->_scripts     = null;
    $doc->_script      = null;
    $doc->_styleSheets = null;