plugin not being showed in non admin user

General questions relating to Joomla! 3.x.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10
Locked
kossel
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Sat Sep 23, 2006 5:30 pm

plugin not being showed in non admin user

Post by kossel » Fri Nov 28, 2014 3:58 pm

I m using joomla 3.3.1 and I'm using a custom template. I installed a plugin call "attachment plugin" so I can add attachment in articles.

The problem is, in the front end it will only show the attachment when you are super user.
I debugged, when you are non-admin the plugin is not even called (no calling on onContentBeforeDisplay) I have programming knowledge but I'm new to joomla, can someone point me out where I should check to find more information to solve the problem? I suspect the Component.php of the theme, it's from "shaper theme" and use something call helix framework.

thanks

User avatar
ltheme
Joomla! Guru
Joomla! Guru
Posts: 666
Joined: Wed Dec 04, 2013 2:43 pm
Location: US
Contact:

Re: plugin not being showed in non admin user

Post by ltheme » Sat Nov 29, 2014 3:22 am

Hi,

You just find HTML override in your template where loading login in content, then you can use this PHP code to check if it's admin role or not

$user = JFactory::getUser();
$usergroup = $user->groups;

So, $usergroup will return an array list (http://docs.joomla.org/Accessing_the_cu ... ser_object) with role from logged user, with this role you can make 'if' conditional function to show/hide content before display in component.
Steve (Mr.) - Fan of Joomla! CMS over 10 years
https://ltheme.com/joomla-templates/ <= 250+ Joomla! templates
https://agethemes.com/free-joomla-templates/ <= Joomla! templates on marketplace
^Compatible with Joomla! 3.x, Joomla! 4.x and Joomla! 5.x

kossel
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Sat Sep 23, 2006 5:30 pm

Re: plugin not being showed in non admin user

Post by kossel » Sat Nov 29, 2014 4:11 am

Hi I tried that and I have done something similar before. but this time, I tried to track down where is that "if" call and I end with onContentBeforeDisplay() function without seeing that "if-permission-check" condition, and looks like the onContentBeforeDisplay() is called buy joomla directly to build the plugin?


Locked

Return to “General Questions/New to Joomla! 3.x”