Quantcast
Channel: Joomla! Forum - community, help and support
Viewing all articles
Browse latest Browse all 1585

Joomla! 5.x Coding • How to check if user is admin in an article.

$
0
0
Trying to create an article overrride that will allow me to append a field if the user is logged in as an admin.
something similar to

Code:

    <div class="com-content-article__body"><?phpecho $this->item->text;if ($user->guest) {{tab title="General"} {field 21} {tab title="Development"}{field 22} {tab title="Troubleshooting"}{field 23} {tab title="Configuration"}{field 25}{/tabs}} else {{tab title="General"} {field 21} {tab title="Development"}{field 22} {tab title="Troubleshooting"}{field 23} {tab title="Configuration"}{field 25} {tab title="Admins"}{field 24} {/tabs}} ?>    </div>
only instead of $user->guest I'd prefer it be $user->admin != '1'
This way the last tab only shows if the user is logged in as an admin.
https://bearsampp.com/faq is the article I'm working on

Statistics: Posted by N6REJ — Wed Jul 03, 2024 7:37 am



Viewing all articles
Browse latest Browse all 1585

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>