Jump to content
tpr

AdminOnSteroids

Recommended Posts

Hello tpr,

here is another z-index problem by showing the source code via CK-Editor.

You gave the divs "breadcrumbs" and "headlines" a z-index of 100011. Now there is a problem if you use the "show source code" function of the CKEditor. This window will be overlapped from the 2 divs in the static bar, because the table which holds the source code has no z-index value (only position static).

The following line of CSS should solve this problem (not tested yet):

table.cke_dialog_contents {z-index: 100012;}

Screenshot_12.jpg

Best regards

  • Like 2

Share this post


Link to post
Share on other sites

Thanks, got it fixed. There's also a cke background overlay that was partially hidden.

  • Like 2

Share this post


Link to post
Share on other sites

Minor css issue - notice the location of the notes icon - this is the iframe that contains the Usage details on a template settings page.

Screen Shot 2016-08-29 at 6.48.30 AM.png

Share this post


Link to post
Share on other sites

How did you add a notes there?

Share this post


Link to post
Share on other sites
4 minutes ago, tpr said:

How did you add a notes there?

I didn't add it - it's the details of the selector. Not sure, but I think maybe this only appears with ListerPro.

Screen Shot 2016-08-29 at 7.28.51 AM.png

  • Like 1

Share this post


Link to post
Share on other sites

That could be ListerPro then, I don't see that. Having no ListerPro to test I can only recommend you to use the "Overlay" style mode for these tooltips :)

  • Like 1

Share this post


Link to post
Share on other sites

Here is a sneak preview of the custom nav items feature I'm working on. They load page lists if applicable, or other pages based on the page type, eg. the Profile page. The main goal is to select pages to add to the main for easy reach. There's also an edit link to the right of the items if you want to edit the page instead list their children.

I haven't found a way to inject these pages with PHP to their destination so the last step involves a bit of JavaScript. If anyone knows how to do this, please share.

aos-navitems.png 

aos_navitems-reno.png      aos_navitems-default.png

  • Like 1

Share this post


Link to post
Share on other sites

I've just added a feature to automatically save module settings to file on uninstall, and restore on install. This way you can uninstall the module without having to re-add settings later if you decide to install again. Additionally, settings can be moved easily from one project to another. With this I can apply more "safe" default settings and leave the more advanced stuff to those who need them.

  • Like 3

Share this post


Link to post
Share on other sites
On 2016. augusztus 24. at 9:43 AM, bernhard said:

and should not be something you need steroids for... maybe you can make an issue on github and talk to ryan what is the reason for it?

Sounds pretty cool! Thanks.

Share this post


Link to post
Share on other sites

Actually there will be a fix for this in the next AOS. As I wrote on GitHub, the problem apparently comes from the navigation having 0.5em top margin, which will be 7.5px, and jQuery uses this value. I've set the margin-top to 8px which is safe enough I think.

Share this post


Link to post
Share on other sites

I would also like to join the feature request club :) 

This topic reminded me of what I currently do in WordPress development:

Besides being able to identify a site, it is also a good thing to tell apart the various instances of the sites we have (development, staging, live version, etc...). In the case of WordPress I use wp-cli to automatically update the site admin's color (the so called "Admin Color Scheme" setting), so that live sites are always in red, dev sites are in blue and staging sites are in purple. In the past, it happened to me that I worked in the wrong admin.... but with this skin changing trick, I'm far less likely to make this mistake again.

Now back to ProcessWire :) My idea is that we could set a value in in config.php, such as $config->adminHeaderColor = #FF3935; which is used by AOS to change the background color of the header. Thanks to AOS I apply sticky headers, so this color indicator could be a strong one.

BTW, here is another related feature idea: it would be cool if we could change the ProcessWire logo easily with AOS, replacing it with the client's logo.

  • Like 2

Share this post


Link to post
Share on other sites
3 minutes ago, szabesz said:

it would be cool if we could change the ProcessWire logo easily with AOS, replacing it with the client's logo.

there was some discussion about this years ago: 

don't know how ryan sees this nowadays where pw should be more a framework than a cms...

  • Like 1

Share this post


Link to post
Share on other sites

@bernhard Thanks for the link to the topic! I skimmed through Ryan's replies and the only thing that seems to matter is this:

" I do think the software name ProcessWire, version number and copyright should always remain in the footer of the admin at least."

I agree, I never wanted to remove these :) Also, I always educate my clients and teach them the name of the underlying system(s)/pieces of software they use. 

Share this post


Link to post
Share on other sites

Well if I release 054 you could add js/css tweaks on your own, because AOS will automatically add admin.js and admin.css from "/site/templates" dir. I concluded that this is the best place to have them but please tell if you have other opinion.

Changing colors is not that easy, unfortunately. It could be great if someone could take the time and separate color-related stuff in a scss file. This way colors could be edited as variables.

I've experimented with css3 features like hue-rotation, saturation and such, and results were great, apart from the fact that if I turned off "NoAnims" in AOS, admin became very sluggish. Even with no animations I suspect many computers would have tough times rendering the admin, unfortunately.

I've also added a feature to add extra items to the navigation besides the CustomNavItems I showcased earlier. This allows adding any part of the admin, eg. direct link to the translator or module edit screens:

Translator: setup/language-translator/edit/?language_id=1066&textdomain=site--templates--_strings-php
HelloWorld module: module/edit?name=Helloworld
//disabled item
!AdminOnSteroids: module/edit?name=AdminOnSteroids

 

  • Like 2

Share this post


Link to post
Share on other sites
23 minutes ago, tpr said:

AOS will automatically add admin.js and admin.css from "/site/templates" dir. I concluded that this is the best place to have them but please tell if you have other opinion.

Wow :) I will try it out for sure. As for the path, well, I do not think we have other viable options than using this path, so let's go for it, maybe with an additional subfolder to keep things organized, such as: /site/templates/aos or /site/templates/AdminOnSteroids which is longer, but more concise than "aos".

About the color issue: I was just thinking about something like this (sorry for the actual colors, it is just an example...):

#masthead, #branding, .main-nav-toggle { background-color: red !important; }
#ProcessPageSearchQuery { background-color: darkred !important; }

I do not want to recolor the admin, the WP part of the comment is just an example I'm familiar with. Changing the head is just enough for the use case I've outlined. But with the new admin.js and admin.css feature one can easily do this.

Edited by szabesz
typos

Share this post


Link to post
Share on other sites
3 hours ago, szabesz said:

Besides being able to identify a site, it is also a good thing to tell apart the various instances of the sites we have (development, staging, live version, etc...). In the case of WordPress I use wp-cli to automatically update the site admin's color (the so called "Admin Color Scheme" setting), so that live sites are always in red, dev sites are in blue and staging sites are in purple. In the past, it happened to me that I worked in the wrong admin.... but with this skin changing trick, I'm far less likely to make this mistake again.

Not to be a feature stealer :), but I wonder if an icon/label on the Tracy debugbar might be a decent approach for this? Maybe not if you don't have the debugbar enabled in the backend? Or maybe if you typically don't want it on in the backend, then you could just have this "PW Instance" panel enabled for the backend, but no others?

I was thinking of adding a field where you can type the "label" for the current site - ie "Dev", "Staging", "Live" etc and then would be displayed in the debug bar. You could also choose an icon color along with the label.

Any thoughts on this vs coloring the header via AOS?

Share this post


Link to post
Share on other sites
4 hours ago, szabesz said:

BTW, here is another related feature idea: it would be cool if we could change the ProcessWire logo easily with AOS, replacing it with the client's logo.

I'd love to see this - I don't think it is taking away from PW branding - in fact I'd be happy to see the PW logo in the footer instead. I think as well as making the client feel like it's a system customized for them, I think the actual key benefit is providing another key visual trigger to let you know what site's admin you are currently looking at.

  • Like 2

Share this post


Link to post
Share on other sites
25 minutes ago, adrian said:

Any thoughts on this vs coloring the header via AOS?

Thanks for the idea, however, I used to use a prominent "corner ribbon" (eg https://codepen.io/eode9/pen/twkKm) but it was not enough, I did make the stupid mistake even thought it was big and red. Maybe its just me, I dunno... The header bar is even bigger and more prominent when it is "sticky", so I hope that will do.

BTW, I normally have Tracy turned off for the backend, it's only enabled when fiddling with admin hacks :P, and this sort of feature probably fits AOS better, I suppose.

  • Like 1

Share this post


Link to post
Share on other sites
33 minutes ago, adrian said:

I'd be happy to see the PW logo in the footer instead

+1

What happens when we click on it, anyway? It does not take us to processwire.com but... ;) The proposed footer logo / current text version should be linked though.

  • Like 2

Share this post


Link to post
Share on other sites

In case you haven't come across with this beautiful blog post from... well, myself, here is another approach to easily distinguish different projects:

Per Project Chrome Instances

This approach has other benefits too: better isolation, saved passwords, bookmarks bar for the current projet only, etc.

  • Like 1

Share this post


Link to post
Share on other sites
1 hour ago, adrian said:

I'd love to see this - I don't think it is taking away from PW branding - in fact I'd be happy to see the PW logo in the footer instead. I think as well as making the client feel like it's a system customized for them, I think the actual key benefit is providing another key visual trigger to let you know what site's admin you are currently looking at.

I agree,  being able to do a little welcoming branding for the client is really great.

I am doing that with a few lines of JS and CSS already, placing another logo (at least) next to the PW logo. Not perfect but it works.

 

Share this post


Link to post
Share on other sites
1 hour ago, tpr said:

In case you haven't come across with this beautiful blog post from... well, myself, here is another approach to easily distinguish different projects:

Per Project Chrome Instances

This approach has other benefits too: better isolation, saved passwords, bookmarks bar for the current projet only, etc.

Beautiful blog post indeed! :D However, you used the keywords: "for the current project only". I mean, I mixup the admins of the same project, so that is what I've solved with different admin theme colors. It would be an overkill to launch 4 Chrome instances for a project, 2 or three for another, and trying to tell the instances apart from my macOS dock would be frustrating. I also use other browsers too sometimes (for example here is Blisk I recently learnt about here, in the forums), although Chrome is my favorite for development so far.

Share this post


Link to post
Share on other sites

How many admins do you have for one project? :) I try to work on one project at a time, and only one Chrome instance is running + one for everything else.

Share this post


Link to post
Share on other sites

The use case is this: I have a local dev instance and I also have the live site and sometimes even another staging instance for testing another "branch". So same project, but different environments running different clones of the site. It does matter whether I make changes to the live site or to my local instance ;) Since the admin area looks identical, it is easy to pick the wrong tab without noticing, especially around midnight :P

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By bernhard
      --- Please use RockFinder3 ---
    • By MoritzLost
      Cacheable Placeholders
      This module allows you to have pieces of dynamic content inside cached output. This aims to solve the common problem of having a mostly cacheable site, but with pieces of dynamic output here and there.  Consider this simple example, where you want to output a custom greeting to the current user:
      <h1>Good morning, <?= ucfirst($user->name) ?></h1> This snippet means you can't use the template cache (at least for logged-in users), because each user has a different name. Even if 99% of your output is static, you can only cache the pieces that you know won't include this personal greeting. A more common example would be CSRF tokens for HTML forms - those need to be unique by definition, so you can't cache the form wholesale.
      This module solves this problem by introducing cacheable placeholders - small placeholder tokens that get replaced during every request. The replacement is done inside a Page::render hook so it runs during every request, even if the response is served from the template cache. So you can use something like this:
      <h1>Good morning, {{{greeting}}}</h1> Replacement tokens are defined with a callback function that produces the appropriate output and added to the module through a simple hook:
      // site/ready.php wire()->addHookAfter('CachePlaceholders::getTokens', function (HookEvent $e) { $tokens = $e->return; $tokens['greeting'] = [ 'callback' => function (array $tokenData) { return ucfirst(wire('user')->name); } ]; $e->return = $tokens; }); Tokens can also include parameters that are parsed and passed to the callback function. There are more fully annotated examples and step-by-step instructions in the README on Github!
      Features
      A simple and fast token parser that calls the appropriate callback and runs automatically. Tokens may include multiple named or positional parameters, as well as multi-value parameters. A manual mode that allows you to replace tokens in custom pieces of cached content (useful if you're using the $cache API). Some built-in tokens for common use-cases: CSRF-Tokens, replacing values from superglobals and producing random hexadecimal strings. The token format is completely customizable, all delimiters can be changed to avoid collisions with existing tag parsers or template languages. Links
      Github Repository & documentation Module directory (pending approval) If you are interested in learning more, the README is very extensive, with more usage examples, code samples and usage instructions!
    • By Craig
      I've been using Fathom Analytics for a while now and on a growing number of sites, so thought it was about time there was a PW module for it.
      WayFathomAnalytics
      WayFathomAnalytics is a group of modules which will allow you to view your Fathom Analytics dashboard in the PW admin panel and (optionally) automatically add and configure the tracking code on front-end pages.
      Links
      GitHub Readme & documentation Download Zip Modules directory Module settings screenshot What is Fathom Analytics?
      Fathom Analytics is a simple, privacy-focused website analytics tool for bloggers and businesses.

      Stop scrolling through pages of reports and collecting gobs of personal data about your visitors, both of which you probably don't need. Fathom is a simple and private website analytics platform that lets you focus on what's important: your business.
      Privacy focused Fast-loading dashboards, all data is on a single screen Easy to get what you need, no training required Unlimited email reports Private or public dashboard sharing Cookie notices not required (it doesn't use cookies or collect personal data) Displays: top content, top referrers, top goals and more
    • By daniels
      This is a lightweight alternative to other newsletter & newsletter-subscription modules.
      You can find the Module in the Modules directory and on Github
      It can subscribe, update, unsubscribe & delete a user in a list in Mailchimp with MailChimp API 3.0. It does not provide any forms or validation, so you can feel free to use your own. To protect your users, it does not save any user data in logs or sends them to an admin.
      This module fits your needs if you...
      ...use Mailchimp as your newsletter / email-automation tool ...want to let users subscribe to your newsletter on your website ...want to use your own form, validation and messages (with or without the wire forms) ...don't want any personal user data saved in any way in your ProcessWire environment (cf. EU data regulation terms) ...like to subscribe, update, unsubscribe or delete users to/from different lists ...like the Mailchimp UI for creating / sending / reviewing email campaigns *I have only tested it with PHP 7.x so far, so use on owners risk
      EDIT:
      Since 0.0.4, instructions and changelog can be found in the README only. You can find it here  🙂
      If you have questions or like to contribute, just post a reply or create an issue or pr on github, thanks!
    • By MoritzLost
      Sorry for the convoluted title. I have a problem with Process modules that define a custom page using the page key through getModuleInfo (as demonstrated in this excellent tutorial by @bernhard). Those pages are created automatically when the module is installed. The problem is that the title of the page only gets set in the current language. That's not a problem if the current language (language of the superuser who is installing the module) is the default language; if it isn't, the Process page is missing a title in the default language. This has the very awkward effect that a user using the backend in the default language (or any other language) will see an empty entry in the setup menu:

      This screenshot comes from my Cache Control module which includes a Process page. Now I realize the description sounds obscure, but for us it's a common setup: We a multiple bilingual sites where the default language is German and the second language is English. While the clients use the CMS in German, as a developer I prefer the English interface, so whenever I install a Process module I get this problem.
      As a module author, is there a way to handle this situation? I guess it would be possible to use post-installation hooks or create the pages manually, but I very much prefer the declarative approach. The page title is already translatable (through the __ function), but of course at the time of installation there is no translation, and as far as I'm aware it's not possible to ship translations with a module so they are used automatically. Could this situation be handled better in the core? I would prefer if the module installation process would always set the title of the Process page in the default language, instead of the language of the current user.
×
×
  • Create New...