Forgot?

Creating more icon slots and javascript issue

Reply Topic
Link to this post 03 Feb 12

Hey,

I'm using this module to display an image gallery, like a portfolio, where each image leads to a link on the website. It works fine, but I need more slots than 20 and I also wanted the latest project to be displayed on top.

What I did was to reverse the order of the array.
Then I added 80 more icon slots so that I have 100 icon slots.
It works fine to display the projects, except that it takes quite long to load the module in the back-end.
Also, when saving the module, the javascripts always cause a browser error.

Here is a screenshot to display what it looks like:
Your text to link here...
(not my screenshot, but my error message is not in english so it's not useful)

I can click continue 2-3 times and the module is saved.
Is there a way to avoid this error message to appear?
I am not the one who is going to administrate this module in the future so it won't look good with error messages and the increased loading time.

Link to this post 05 Feb 12

Hi Joakim,

Thanks for the screenshot.

Nice modification you have made :)

Ninja Simple Icon Menu doesn't make use of any script.
So it's most likely that the problem is probably caused elsewhere.

What I can imagine is that there are script runtime errors because of the huge pageload of course.
It sounds more like a server related error or caused by another extensions which needs scripts running in the background.

Looking at the screenshot, it points to that specific extension.
You said the screenshot is not yours, but is this situation related to yours?

If so, then try to disable this extensions and see if the javascript issue persists when you open the Ninja Simple Icon Menu Module.

I hope this helps.
Let us know how it goes.

Kind regards
John

Link to this post 06 Feb 12

Hey John Bartels,

Thanks for your reply!

The files that are relevant to my javascript issue are these:

/media/system/js/mootools-core.js:25
/media/system/js/mootools-core.js:261
/media/system/js/validate.js:9

The main reason why I used another screeenshot is because my browser is in a different language.

Everytime I click "Save" within the module I get the mootools-core error message.
Only sometimes do I get the validate.js-message.

I am not sure how to disable these "mootools" and "validate" javascript files without breaking the site. I tried a plugin that is supposed to disable mootools but then another extension stopped working.
Perhaps it's just my code changes that are not very optimal? (I am not a programmer)

I post the code changes here, perhaps someone will find it useful if the javascript issues would go away. I also attached my current version of the .xml file.

1.

Row 21 in mod_ninja_simple_icon_menu.php:

#Only 5 icon slots used in this example. Make sure the first row is the highest number!
$iconParams = array (
array($params->get('icon5_status'),$params->get('icon5_img'),$params->get('icon5_title'),$params->get('icon5_link'),$params->get('icon5_alt'),$params->get('icon5_target')),
array($params->get('icon4_status'),$params->get('icon4_img'),$params->get('icon4_title'),$params->get('icon4_link'),$params->get('icon4_alt'),$params->get('icon4_target')),
array($params->get('icon3_status'),$params->get('icon3_img'),$params->get('icon3_title'),$params->get('icon3_link'),$params->get('icon3_alt'),$params->get('icon3_target')),
array($params->get('icon2_status'),$params->get('icon2_img'),$params->get('icon2_title'),$params->get('icon2_link'),$params->get('icon2_alt'),$params->get('icon2_target')),
array($params->get('icon1_status'),$params->get('icon1_img'),$params->get('icon1_title'),$params->get('icon1_link'),$params->get('icon1_alt'),$params->get('icon1_target'))
);

2.
Another row in the same file:

Search for this text string:
/* loop through our menu items and display the ones we need to display */

Edit the row below (this will load 100 icons):
for ($i=0; $i<100; $i++){

3. Use the attached file to get 100 icon slots.

4. May not display correctly if you set the value in 2. to 100 and then don't have 100 actual icon slots if the order is reversed.

You don't have access to view the attachments in this post.
Link to this post 06 Feb 12

Hi Joakim,

Thanks for your feedback and contribution.

I believe the scripts you are mentioning are belonging to the Joomla 1.7 core.
What they do in the backend, is taking care of the general functionality and usability.

You can't disable these scripts as they are needed for Joomla 1.7.

I'm not a javascript expert but I tried to figure out the lines 25 and 261 of mootools-core.js and it seems it has to do with an overload protection. I guess that would explain the errors you got, because of the huge pageload. Again I'm not sure about this but sounds fair to me.

I'm afraid there's no chance to circumvent these errors in use with your modified version of NSIM.

Maybe it's worth to attach both modified xml and php, so I can do some tests.

I hope this helps.

Kind regards,
John

Link to this post 06 Feb 12

Thanks for the information!

I have attached both the xml and php file for you if you like to run some tests.

Line 130 in my version of the php file has a different path than the original.

In case any comments within the files are missing, it was not my intention to take the credit from the creators. I stripped some code to see if it would have any effect on the error messages and loading times. For instance I also stripped the alt tag from the code, but i experienced no noticable improvements.

Thanks for being so helpful!

You don't have access to view the attachments in this post.
Link to this post 06 Feb 12

Hi Joakim,

No problem.
Thanks for the package.
I will take a look at it as soon as possible and let you know my findings.

-John

Link to this post 14 Feb 12

Hi,

Any new information regarding the errors?

Link to this post 15 Feb 12

Hi Joakim,

I'm sorry, I haven't found the time to test it properly yet.

I will let you know as soon as possible.

I hope this helps.

Kind regards,
John

Link to this post 15 Feb 12

Hi Joakim,

I did a quick test.
But I had to change the image path first. (you had customized that part).

After that:
Sometimes I get the validate.js error too.
But no errors regarding the mootools scripts.

I suspect that the saving time and the pageload are causing temporary timeouts in interaction with the database.
The best way to avoid this is to shorten the list of icons that can be added.
I would suggest 50 icons might be a much error less approach.

Please, keep also in mind that Ninja Simple Icon Menu was not designed to use it the way you want.
It's most likely that errors will occur in extensive use like this.

I hope this helps.
Good luck.

Kind regards,
John

Link to this post 15 Feb 12

Thanks a lot John for having a look!

I will switch to 50 icons instead and see if it works better.

Best regards
Joakim

Link to this post 15 Feb 12

You are welcome anytime, Joakim.

Best,
John

Link to this post 05 Apr 12

hi there,

I'm new here. I got a problem with this module.

this is offline website and still in construction. http://www.maras.org.my is my domain, i can not link to the external article / website because it's show http://www.maras.org.my/www.xxxx.com
I just need direct to the link for example http://www.xxx.com after clik to the icon.

I'm very appreciate for your help.

thanks

Link to this post 05 Apr 12

Hi hrm.malaya,

In Ninja Simple Icon Menu module parameters, make sure all your links are written like this:
http://www.lpp.gov.my
Not like this:
www.lpp.gov.my

Link to this post 05 Apr 12

Hi Mark Simpson,

My problem was solved. Thank you.

Home Forum Joomla Extension Support Ninja Simple Icon Menu Creating more icon slots and javascript issue