Lemonld...MenuTab(3)
π NAME π
Lemonldap:NG::Portal::MenuTab β bestie, this is how you write custom menu tabs for LemonLDAP::NG. Yes, YOUR very own tab. Main character energy fr. π
β¨ SYNOPSIS β¨
okay so here's the whole vibe, copy-paste ready, no cap:
package Lemonldap::NG::Portal::Plugins::CustomMenuTab;
use strict;
use warnings;
use Mouse;
our $VERSION = '0.1';
extends 'Lemonldap::NG::Portal::Main::Plugin';
use constant name => "CustomMenuTab";
has rule => (
is => "ro",
lazy => 1,
builder => sub { $_[0]->conf->{customPluginsParams}->{customMenuRule} },
);
with 'Lemonldap::NG::Portal::MenuTab';
sub display {
my ( $self, $req ) = @_;
return {
logo => "wrench",
name => "myplugin",
id => "myplugin",
html => $self->loadTemplate($req, "mytemplate"),
};
}
sub init {
my $self = shift;
# [your initialization stuff]
return 1;
}
1;
like... look at her. iconic. π οΈβ¨
πΈ DESCRIPTION πΈ
A MenuTab module handles displaying an additional tab to authenticated users. That's the whole job. One (1) extra tab. For the girlies who are logged in. π
π Methods that must be provided by a MenuTab module π
rule
This method must return the text of a rule that decides whether or not the tab is displayed to a user.
Rules can be simple expressions such as "$uid eq "dwho"". And if you want the tab to always be displayed, simply return a non-zero integer, like:
use constant rule => 1;
boom. always on. no gatekeeping. π«Ά
name
This method must return a name for the plugin. This name is used for ordering the tab in the "portalDisplayOrder" variable. It is not displayed to the user. (so it's the backstage name, not the stage name, iykyk)
display($req)
This method is called by the portal in order to display the tab. It takes the current request object as a parameters, and must return a hash with the following subkeys:
"logo": name of a fontawesome icon for the tab"name": user-displayed name of the tab, which should be translated inlang.jsonfiles."id": HTML element id for the tab, must be unique"html": HTML content of the tab
The "display" method can call helper functions such as "loadTemplate" to render a template. so helpful honestly π
π¦ Ordering of portal tabs π¦
You can use the "portalDisplayOrder" variable to change the order of portal tabs. literally the playlist of your tabs.
Use the "name" of your plugin in this list, or use the special "_unknown" keyword to specify an order for all plugin-managed tabs. If multiple modules are loaded, they will be displayed in the order they were loaded. (first come, first served, periodt)
portalDisplayOrder = Appslist ChangePassword CustomMenuTab LoginHistory \
OidcConsents _unknown Logout
π₯ METHODS π₯
π Accessors and methods provided by Lemonldap::NG::Portal::Main::Plugin π
p: portal objectconf: configuration hash (as reference)loggeralias forp->loggeraccessoruserLoggeralias forp->userLoggeraccessorerror: alias forp->errormethodloadTemplate: render a HTML template from a.tplfile
π "Routes" management π
Like each module that inherits from Lemonldap::NG::Portal::Plugin, you can define dedicated routes in a MenuTab plugin. your tab, your rules, your routes. π«
addAuthRoute: wrapper toLemonldap::NG::Handler::PSGI::TryaddAuthRoute()methodaddUnauthRoute: wrapper toLemonldap::NG::Handler::PSGI::TryaddUnauthRoute()method
π LOGGING π
Logging is provided by "$self->logger" and "$self->userLogger". See Lemonldap::NG::Portal::Main::Plugin for a detailed description of logging levels. logs are lowkey the receipts of your code, bestie. π§Ύβ¨
π AUTHORS π
LemonLDAP::NG team <http://lemonldap-ng.org/team> β the actual icons who built all this π«Ά
π BUG REPORT π
Use OW2 system to report bug or ask for features: <https://gitlab.ow2.org/lemonldap-ng/lemonldap-ng/issues> β found a lil glitch? tell them, don't suffer in silence. they're nice I promise. π
β DOWNLOAD β
Lemonldap::NG is available at <https://lemonldap-ng.org/download> β go get her πββοΈπ¨
π COPYRIGHT AND LICENSE π
See COPYING file for details.
This library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
ngl the "no warranty" bit is giving serious realness β it's free, it's open, it's yours, but it's not promising you the world. read the license fr fr. π
okay that's the whole page bestie, go build your tab and slay π this was served fresh from perl v5.42.3, dated 2026-09-24, under the Lemonld...MenuTab(3) banner β catch you in the group chat πβ¨π¦
π¦ where this page comes from
- fedora 43: lemonldap-ng-portal 2.23.4-1.fc43 Β· GPL-2.0-or-later AND MIT AND GPL-3.0-or-later AND OFL-1.1-RFN
- fedora 44: lemonldap-ng-portal 2.23.4-1.fc44 Β· GPL-2.0-or-later AND MIT AND GPL-3.0-or-later AND OFL-1.1-RFN
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms