[ solved ] k2 joomla - fix Tags, when K2 remove spaces and Dashes

Written by  Monday, 11 July 2016 16:52

If you save K2 article and K2 remove from the Tags spases and dashes - we need fix this in function check (). Open administrator\components\com_k2\tables\k2tag.php. Pleace find line 30 and replase this code

// Oldest line 30
$this->name = JString::str_ireplace('-', '', $this->name);

Replase old line in this code:

// approve - and space
$this->name = JString::str_ireplace('-', '—', $this->name);
$this->name = JString::str_ireplace(' ', ' ', $this->name);
347 Read Last modified on Monday, 11 July 2016

Leave a comment

Make sure you enter all the required information, indicated by an asterisk (*). HTML code is not allowed.

Related items

  • How to change tag count limit in woocommerce widget?

    Open function.php and add this code:

    // change counts at blog pages
    add_filter('widget_tag_cloud_args', 'tag_widget_limit'); 
    function tag_widget_limit($args){
     if(isset($args['taxonomy']) && $args['taxonomy'] == 'post_tag'){
      $args['number'] = 300; //Limit number of tags
     }
     return $args;
    }
    
    // change counts in Woocomerce
    function custom_woocommerce_tag_cloud_widget() {
        $args = array(
            'number' => 500,
            'taxonomy' => 'product_tag'
        );
        return $args;
    }
    add_filter( 'woocommerce_product_tag_cloud_widget_args', 'custom_woocommerce_tag_cloud_widget' );

     

  • 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;

     

  • How to Replace a tag to K2 to another via phpMyadmin?

    To replace Teg you should run a query UPDATE. First you need to go to K2-> Tags and find out under what id is required tags. Next in phpMyadmin we insert sql query code like this:

    -- If we want to replace the tag id 6 wherever there is tag with id 12, the request will be so
    UPDATE `you_prefix_k2_tags_xref` SET `tagID` = '6' WHERE `you_prefix_k2_tags_xref`.`tagID` =12;
  • Removing unnecessary fields in the Frontend K2, are allowed to add article to Favorites to moderators Kunena

    Hi People! If you like I need to get rid of annoying and unnecessary ordinary mortal fields in the front, here's what to do:

    Need to go to find it /you_template/com_k2/default/itemform.php lines relating to these items and immediately remove it! :) And to think better and make for a smart ...

    Those who have also installed Kunena forum and they want to make access to the facility and hut Published - can add a condition to check for moderatorstvo calling helper Kunena, like so: