Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/12/2022 in all areas

  1. This module lets you add some custom menu items to the main admin menu, and you can set the dropdown links dynamically in a hook if needed. Sidenote: the module config uses some repeatable/sortable rows for the child link settings, similar to the ProFields Table interface. The data gets saved as JSON in a hidden textarea field. Might be interesting to other module developers? Custom Admin Menus Adds up to three custom menu items with optional dropdowns to the main admin menu. The menu items can link to admin pages, front-end pages, or pages on external websites. The links can be set to open in a new browser tab, and child links in the dropdown can be given an icon. Requires ProcessWire v3.0.178 or newer and AdminThemeUikit. Screenshots Example of menu items Module config for the menus Link list shown when parent menu item is not given a URL Advanced Setting child menu items dynamically If needed you can set the child menu items dynamically using a hook. Example: $wire->addHookAfter('CustomAdminMenus::getMenuChildren', function(HookEvent $event) { // The menu number is the first argument $menu_number = $event->arguments(0); if($menu_number === 1) { $colours = $event->wire()->pages->findRaw('template=colour', ['title', 'url', 'page_icon']); $children = []; foreach($colours as $colour) { // Each child item should be an array with the following keys $children[] = [ 'icon' => $colour['page_icon'], 'label' => $colour['title'], 'url' => $colour['url'], 'newtab' => false, ]; } $event->return = $children; } }); Create multiple levels of flyout menus It's also possible to create multiple levels of flyout submenus using a hook. For each level a submenu can be defined in a "children" item. Example: $wire->addHookAfter('CustomAdminMenus::getMenuChildren', function(HookEvent $event) { // The menu number is the first argument $menu_number = $event->arguments(0); if($menu_number === 1) { $children = [ [ 'icon' => 'adjust', 'label' => 'One', 'url' => '/one/', 'newtab' => false, ], [ 'icon' => 'anchor', 'label' => 'Two', 'url' => '/two/', 'newtab' => false, 'children' => [ [ 'icon' => 'child', 'label' => 'Red', 'url' => '/red/', 'newtab' => false, ], [ 'icon' => 'bullhorn', 'label' => 'Green', 'url' => '/green/', 'newtab' => false, 'children' => [ [ 'icon' => 'wifi', 'label' => 'Small', 'url' => '/small/', 'newtab' => true, ], [ 'icon' => 'codepen', 'label' => 'Medium', 'url' => '/medium/', 'newtab' => false, ], [ 'icon' => 'cogs', 'label' => 'Large', 'url' => '/large/', 'newtab' => false, ], ] ], [ 'icon' => 'futbol-o', 'label' => 'Blue', 'url' => '/blue/', 'newtab' => true, ], ] ], [ 'icon' => 'hand-o-left', 'label' => 'Three', 'url' => '/three/', 'newtab' => false, ], ]; $event->return = $children; } }); Showing/hiding menus according to user role You can determine which menu items can be seen by a role by checking the user's role in the hook. For example, if a user has or lacks a role you could include different child menu items in the hook return value. Or if you want to conditionally hide a custom menu altogether you can set the return value to false. Example: $wire->addHookAfter('CustomAdminMenus::getMenuChildren', function(HookEvent $event) { // The menu number is the first argument $menu_number = $event->arguments(0); $user = $event->wire()->user; // For custom menu number 1... if($menu_number === 1) { // ...if user does not have some particular role... if(!$user->hasRole('foo')) { // ...do not show the menu $event->return = false; } } }); https://github.com/Toutouwai/CustomAdminMenus https://processwire.com/modules/custom-admin-menus/
    1 point
  2. Hi @AndZyk. You are right. Thanks for your thoughts. I'll have a talk with @Pete. Currently, Padloper has a VIP support forum. However, not everyone who is interested in the module has access to that forum. Thanks.
    1 point
  3. Basically something like this: image: atlassian/default-image:2 definitions: # Copy files and exclude the ones from .gitignore, # which includes logs and custom overrides out of version control. # Run latest migrations if existing. script: &deploy-script rsync --stats --human-readable --recursive --delete-after --no-perms --no-owner --no-group --exclude-from=$BITBUCKET_CLONE_DIR/.gitignore --exclude="bitbucket-pipelines.yml" $BITBUCKET_CLONE_DIR/* $SERVER_USER@$SERVER_ADDRESS:$APP_PATH; ssh $SERVER_USER@$SERVER_ADDRESS "php $APP_PATH/modules/Migrations/bin/migrate run"; pipelines: branches: main: - step: name: awesomewebsite.com script: - SERVER_USER=$USER - SERVER_ADDRESS=$SERVER - APP_PATH=$PATH - *deploy-script dev: - step: name: dev.awesomewebsite.com script: - SERVER_USER=$DEV_USER - SERVER_ADDRESS=$DEV_SERVER - APP_PATH=$DEV_PATH - *deploy-script So it's like a tad bit more fancy FTP upload lol
    1 point
  4. At the moment the site layout is not responsive. The problem is hidden in the footer. <nav class="footer_nav"> <ul class="flex justify-center space-x-10 uppercase"> To prevent horizontal scrolling on smartphones, you need to add one more element - flex-wrap. <nav class="footer_nav"> <ul class="flex flex-wrap justify-center space-x-10 uppercase">
    1 point
  5. Hello @kongondo, I am not a Padloper user, but I have noticed an increasing number of Padloper threads in the Dev Talk topic. Right now I am counting 6 threads for Padloper (1 pinned). Wouldn't it be better to have a dedicated place for Padloper? For example here: https://processwire.com/talk/forum/57-module-specific-support/ Since Padloper is a module and the Dev Talk section is "A place for general development and coding discussions." I think this would be a better solution for Padloper and non-Padloper users. ? Regards, Andreas
    1 point
  6. You can change that through the module settings. In your backend, go to Modules -> Configure -> ProcessLogin. There you'll find the Login Type setting which you can set to allow login with username, email or both.
    1 point
  7. Font Awesome 5 Pro for ProcessWire At Github: https://github.com/outflux3/FontAwesomePro I whipped up a font awesome pro module so that i could use those icons in the admin; it will be one of those "BYO vendor files", so you'd load your own Font Awesome 5 Pro assets once you buy it (about 1 day left to get the discounted pro license!)... Just posting this here in case anyone else ...is working on something similar ...already built something like this ...wants to collaborate on it} The webfont version basically works well in current admin theme but requires a custom css with fontface redefinition to refer to legacy 'fontAwesome' which is used in the admin css. The svg framework seems to work well, and leaving in the legacy font-awesome means that any icons that can't be replaced by JS are still visible (like :after psuedo classes); SVG framework only works with solid, probably because the new prefixing (fal for light, far for regular..) This is also going to be interesting for future admin themes, and the new 'regular' style is cute... Solid (default): dashboard example showing more icons: SVG framework:
    1 point
×
×
  • Create New...