Items filtered by date: December 2015

This tutorials will allow you to run a second instance of a plugin completely separate. We will be using K2 Extended search for this tutorial as this is a prime example of why you would want this feature.

Scenario

I wanted to be able to run 2 instances of this plugin because I made the plugin so I could specify which categories and articles it searched. With 2 instances of the same plugin I can now have search results for certain categories or knowledge bases in separate search names spaces in a Joomla search. This allows easier searching and I can also control the results easier.

Prerequisites

  • Workout you new name for the plugin. If you just want a second instance of a plugin keep the file names name similar. K2 Extended Search B
  • Extract the plugin package on your PC

Files

  • Rename the following files as show below. You will see I have just appended ‘b’ on the end of k2extended to keep in line with your new plugin name. You could use a program to change all of these file names as per your choice
    • k2extended.php à k2extendedb.php
    • k2extended.xml à k2extended.xml
    • language/en-GB/ en-GB.plg_search_k2extended.ini
      -->
      language/en-GB/ en-GB.plg_search_k2extendedb.ini
    • language/en-GB/ en-GB.plg_search_k2extended.sys.ini
      -->
      language/en-GB/ en-GB.plg_search_k2extended.sys.ini

File Content

  • Open all plugin files in Notepad++
  • With case sensitivity on, Text replace in all open files K2EXTENDED à K2EXTENDEDB
  • With case sensitivity on, Text replace in all open files k2extended àk2extendedb
  • Change the plugin descriptions as required in k2extendedb.xml
  • In k2extendedb.php change (the class title)
    class plgSearchK2Extended extends JPlugin
    -->
    class plgSearchK2ExtendedB extends JPlugin

Finalization

  • Zip up the files
  • Upload the new plugin to your test server to make sure it works as expected and does not overwrite your donor’s plugin
Published in Extension Development

When developing a Joomla extension, and most likely a standalone extension you receive the following error or similiar:

Strict Standards: Only variables should be assigned by reference in /plugins/editors-xtd/executecode/script.php on line 22

Solution

The error is most likely down to a line similiar to this

$app =& JFactory::getApplication('administrator');

Notice the =&, in PHP5+ you should not longer use this. The line should look like this without the &

$app = JFactory::getApplication('administrator');

Explanation

Remove the & because as off PHP5 it is no longer required and is still only present in PHP5 for legacy code and will be removed in further iterations of PHP.

As of PHP 5, the new operator returns a reference automatically, so assigning the result of new by reference results in an E_DEPRECATED message in PHP 5.3 and later, and an E_STRICT message in earlier versions.

My understanding of this is that PHP5 automatically creates a reference to the objects value and does not copy the value, this makes =& redundant because you no longer need to manually specify this feature. With a reference if you alter the value in either the variable or the object value then the other is changed aswell, hence the term reference.

If you look in the Joomla index.php files you will see there is no =&

// Instantiate the application.
$app = JFactory::getApplication('site');

or in the administrator

// Instantiate the application.
$app = JFactory::getApplication('administrator');

Other Solutions

These are some other solutions I have come across that people use

  1. Append @ to the beginning of the statement, this causes PHP to supress errors for this statement
    @$app =& JFactory::getApplication('administrator');
  2. Supress errors via the php.ini file

These should be avoided as hiding errors does not mean they have been fixed.

Links

Published in Extension Development
Sunday, 20 December 2015 20:25

JSN-Yoyo

Published in JSN Templates
Sunday, 20 December 2015 20:24

JSN-Vintage

Menu

/* footer div menu fix */
ul.menu-divmenu {
    margin: 0 auto;
    padding: 0;
    list-style: none;
}
ul.menu-divmenu li {
    display: inline-block;
}

 

/* footer div menu fix */
ul.menu-divmenu {
    margin: 0 auto;
    padding: 0;
    list-style: none;
}
ul.menu-divmenu li {
    display: inline-block;
}

 

/* fixes footer menu getting the word 'menu' getting attached */
.jsn-menu-mobile-control, ul.menu-topmenu .jsn-menu-mobile-control {
	display: none !important;
}

Slider

/* remove gap under slider - on homepage - if needed */
.jsn-homepage #jsn-promo-inner {
	background-repeat: repeat-x;
	background-position: left bottom;
	height: auto;
	padding-bottom: 10px;
    z-index: 100; 
}

 

/* frame-1a with frame-correction in content-top jsn_vintage */

/* Double Grey Border and 3D Shadow */
.frame-1a {
    -moz-border-bottom-colors: none;
    -moz-border-left-colors: none;
    -moz-border-right-colors: none;
    -moz-border-top-colors: none;
    background: transparent -moz-linear-gradient(center top , #fafafa, #dddddd) repeat scroll 0 0;
    border-color: #c9cbcd;
    border-image: none;
    border-radius: 0;
    border-style: solid;
    border-width: 1px 1px 2px;
    box-shadow: 0 8px 6px -6px black;
    display: inline-block;
    outline: medium none;
    padding: 4px;
    transition: all 300ms ease-out 0s;
}
/* main slider correction - add this to the slider module class suffix  */
.frame-correction {padding-top: 10px;}

 

 

 

Published in JSN Templates
Sunday, 20 December 2015 20:24

JSN-Venture

Published in JSN Templates
Sunday, 20 December 2015 20:24

JSN-Time

General

/* add padding to blog images */
.jsn-layout-blog .pull-left.item-image img  {
	padding: 20px;
}

 

/* fix squashed article contents */
.article-contents {
	display: inherit;
}

Header

/* Remove Header background image */
#header-inner{background: none;}

 

/* Disable the world image in header */
#header-inner {background-image: none;}

 

/* Remove logo white background */
#jsn-logo {background-color: transparent;}

 

/* Remove topbar padding and margins */ 
#jsn-topheader-inner {padding-top: 0;}

 

/* reduce gap between logo and menu */
#jsn-topheader {margin-bottom: 0;}

Menu

/* create a 100% wide menu background */
#jsn-body{
	border-top: 51px solid #222222;
	margin-top: -51px;
}

If you you need to make the menu taller just increase both 51px.

/* remove line/border below menu  */
#jsn-body {
    border-top: none;
}

 

/* Make Main Menu Grey */
#jsn-menu {
    background-color: #EFEFEF;  /*#EFEFEF  this is very common*/
    box-shadow: none;
}

Bug Fixes

/*  Bug Fix - Content goes of the side - I think that is what this fixes  */
@media only screen and (min-width: 481px) and (max-width: 768px), (min-device-width: 481px) and (max-device-width: 768px) and (orientation:portrait) {
	#header-inner{
	width: inherit !important;
	margin: 0 auto;
	}
}

module responsive suffix do not work

Please check the file template_pro.css at line 30:

#jsn-page
	transition: width 0.3s ease-in-out;
	-moz-transition: width 0.3s ease-in-out;
	-webkit-transition: width 0.3s ease-in-out;
}

The code is missing a "{" after #jsn-page that makes the code incorrect, so all the css after this point is not parsed.

The correct code:

#jsn-page {
	transition: width 0.3s ease-in-out;
	-moz-transition: width 0.3s ease-in-out;
	-webkit-transition: width 0.3s ease-in-out;
}

Then all the class suffix will work fine.

Right hand side is cut off - responsive failed (not all verified as there seems to be 2 soluitions)

The issue has been fixed by changing some css 'css/layouts/jsn_mobile.css' at line 20:

#jsn-pos-topbar,
#jsn-topheader-inner,
#header-inner,
#jsn-header-inner,
#jsn-pos-promo-full,
#jsn-promo-inner,
#jsn-pos-content-top,
#jsn-pos-content-top-below,
#jsn-content,
#jsn-content-bottom-inner,
#jsn-usermodules3-inner,
#jsn-content-bottom-mid-inner,
#jsn-content-bottom-below-inner,
#jsn-footer-inner {
	width: 100%; /* change from width: 1170px; */
	min-width: inherit;
	box-sizing: border-box;
	-moz-box-sizing: border-box;
	-webkit-box-sizing: border-box;
}

'css/layouts/jsn_mobile.css' at line 783:

#jsn-pos-promo {
	margin: 0;   /* change from margin: 0 20px; */
}

the issue is not fixed. The template changer, the right column and and main content area get cut off. Just like before

In templates/jsn_time_pro/css/layouts/jsn_mobile.css line 34

width: 1170px changed to width: 100%;

In 'templates/jsn_time_pro/css/template.css' line 239, add this code:

@media only screen and (max-width: 1199px), (max-device-width: 1199px) {
	#jsn-pos-topbar,
	#jsn-topheader-inner,
	#header-inner,
	#jsn-pos-promo-full,
	#jsn-promo-inner,
	#jsn-pos-content-top,
	#jsn-pos-content-top-below,
	#jsn-content,
	#jsn-content-bottom-inner,
	#jsn-usermodules3-inner,
	#jsn-content-bottom-mid-inner,
	#jsn-content-bottom-below-inner,
	#jsn-footer-inner {
		width: 100%;
	}
}

cannot change font size in template config

remove the following from the tempalte.css

.article-contents{
	font-size: 14px;
}

 

Published in JSN Templates
Sunday, 20 December 2015 20:24

JSN-Tendo

Published in JSN Templates
Sunday, 20 December 2015 20:24

JSN-Teki

Published in JSN Templates
Sunday, 20 December 2015 20:24

JSN-Solid

/* Fix Contact Form going off screen to the left in tablet*/
#jsn-maincontent.span12 #jsn-pos-innerright > div {
  padding-left: 0px;
  margin-left: 10px;
}

 

/* correct white space on the left of the header */
#jsn-header {
    padding: 0px 0px;
}

 

/* fix footer menu not <li> not going inline when using main menu items */

/*
ul.menu-divmenu li {
float: left !important;
}
*/

ul.menu-divmenu {
	margin: 0 auto;
	padding: 0;
	list-style: none;
}
ul.menu-divmenu li {
	display: inline-block;
}

 

Published in JSN Templates
Sunday, 20 December 2015 20:24

JSN-Sky

/* Custom background but leave inner white */
#jsn-page {background: url("../images/custom/background.jpg") no-repeat fixed center;}

 

/* remove white background */
#jsn-header_inner,
#jsn-headerright,
#jsn-footer {
	background: none;
}

 

/* make header black */
#jsn-headerright-inner {background: black;}

 

/* Reduce border to inner only */
#jsn-header_inner {border: none;}
#jsn-header_inner2 {border-bottom: 1px solid #DDD;}

 

/* make content background white */
#jsn-content, #jsn-header_inner2 {background: white;}

 

/* remove gap between content and footer */
#jsn-footer {padding: 0px 0px 10px;}

 

/* make footer black */
#jsn-footer_inner {background: #111111;}

 

/* add padding to the content as it is on the edge */
#jsn-mainbody { padding-left: 10px; padding-right: 10px;}

 

Published in JSN Templates
Page 1 of 10