Jump to content
Michael Murphy

Simple responsive documentation admin theme

Recommended Posts

I’ve been working on a simple admin theme. I originally just wanted to add a simple dashboard area on the home page to display some quick links to key actions and documentation for clients, but I ended up doing a whole theme. The main focus of the theme is for the client / editor role, so it’s not been optimised for the developer usage yet. There are a few enhancements which are aimed at clients (opening previews in a new window, showing tree actions on hover). I have also tried to optimise it for mobile layout. You can see a preview on this video

It’s using the Bootstrap framework and Open Sans font.

The main issues I currently have are a conflict with the Bootstrap framework scripts and the older version of Jquery that ships with the PW admin. If I upgrade to Jquery 1.8.2 a lot of PW admin functionality breaks (sorting, ask select, modals). If I stick with the currently shipped version of jQuery 1.6, the bootstrap scripts do not work (drop downs, message alerts, mobile navigation).

The other big issue, is I made a few simple hacks to some core js files (/wire/modules/Process/ProcessPageList/ProcessPageList.js, and /wire/modules/Jquery/JqueryWireTabs/JqueryWireTabs.js) - this was mainly to insert extra css classes here and there or to show if the tree has children. Is there a better way to do this?

Other issues I am thinking about

Is there a way to modify the “add new page” workflow? So when the user adds a new page, I’d like to change the default “You are adding a page using the …” message. Maybe this could be an additionally template field called “instructions” or “”details” ? It could be a used as a kind of “templates documentation”, which could be used to document the project for other devs and designers and for the clients / editors.

How can you modify the login screen without overriding this file (/wire/modules/Process/ProcessLogin/ProcessLogin.module)?

Also not to sure if having two save buttons is good for usability - maybe I will just have one in the header and make it fixed as you scroll.

  • Like 15

Share this post


Link to post
Share on other sites

Looks very nice and some very great thinking there!

About adding new page: what I have been missing would be a quick way to add multiple pages at once. Something like:

  1. Click "new"
  2. Opens "inline" or modal view for page title, name and possible template
  3. Click save, page is added as unpublished to a tree
  4. You can click "new" again etc...

Share this post


Link to post
Share on other sites

This is fantastic!

Hah, it seems that people are doing a lot of stuff I wanted to do, "once". This will save me a lot of time, thanks! :)

Share this post


Link to post
Share on other sites

I like it. I had plans of making my own mobile theme, but didn't have much time to do so...

Can't wait to try it on mobile :)

Share this post


Link to post
Share on other sites

Looking great! Love what you are doing with this.

The main issues I currently have are a conflict with the Bootstrap framework scripts and the older version of Jquery that ships with the PW admin. If I upgrade to Jquery 1.8.2 a lot of PW admin functionality breaks (sorting, ask select, modals). If I stick with the currently shipped version of jQuery 1.6, the bootstrap scripts do not work (drop downs, message alerts, mobile navigation).

The dev branch (targeted as the upcoming v2.3) currently has jQuery 1.8.3 and the latest jQuery UI, so this issue will resolve itself shortly. If you'd like to switch to it on your dev server, I could definitely use help testing.

The other big issue, is I made a few simple hacks to some core js files (/wire/modules/Process/ProcessPageList/ProcessPageList.js, and /wire/modules/Jquery/JqueryWireTabs/JqueryWireTabs.js) - this was mainly to insert extra css classes here and there or to show if the tree has children. Is there a better way to do this?

If you can tell me more specifically what you need changed, I can update the core to support it, or can suggest an alternative.

Is there a way to modify the “add new page” workflow? So when the user adds a new page, I’d like to change the default “You are adding a page using the …” message. Maybe this could be an additionally template field called “instructions” or “”details” ? It could be a used as a kind of “templates documentation”, which could be used to document the project for other devs and designers and for the clients / editors.

I'm not totally sure I understand the request. You mentioned workflow, but sounds like you are mainly interested in just changing some text? Either way, I'm sure I can make it hookable if it's not already. For really major changes, another option is you can always add another Page Add process of your own (under a different name) and update the 'process' variable of /processwire/page/add/ to point to your process rather than the default one.

How can you modify the login screen without overriding this file (/wire/modules/Process/ProcessLogin/ProcessLogin.module)?

Several things are hookable here, and if we don't have what you need now, I'm happy to modify it to make it more hookable. Tell me more specifically what you are trying to do here and I should be able to find a way.

Also not to sure if having two save buttons is good for usability - maybe I will just have one in the header and make it fixed as you scroll.

Technically there's only 1 save button in the markup. The second one is created by the javascript in /wire/templates-admin/scripts/main.js. As a result, this is admin-theme specific, and getting rid of it would just mean deleting some JS out of your /site/templates-admin/scripts/main.js

  • Like 1

Share this post


Link to post
Share on other sites

Thanks for the kind words and feedback.

I have just tested with the latest dev version and that solves the jQuery conflicts.

About changing the "add new page workflow", for now I would be more interested in just customising the text. Something like

"You are about to add a new “template name”. [Thumbnail Screenshot of template or icon]

More details (about this template)

Cancel or change template (if possible)".

Maybe this could also be expanded to include cases like what @apesia describes above so you could add specific rules. Need to think about that some more.

Regarding the login module, I would like to hide a few things like the home link, and also be able to add some extra text like "need access or forgotten your password - please contact ……"

Now I need to work out how to distribute the documentation / quick links part as an extra module. The module will be quite simple - it will insert a new page / template called "documentation" which will have a text area for quick links and the documentation. I've never created a module before, so any advice here is welcome.

Here are the changes I made to some core files

/wire/modules/Process/ProcessPageList/ProcessPageList.js

added this to line 442 so I can change the icons in the tree to indicate pages with children

if(child.numChildren > 0) {
$numChildren.addClass('hasChildren');
$li.addClass('hasChildren');
}

/wire/modules/Jquery/JqueryWireTabs/JqueryWireTabs.js

changed line 26 so I could use the tab classes used in bootstrap

var $tabList = $("<ul></ul>").addClass("WireTabs nav nav-tabs");

changed line 76 and 77

var $oldTab = $($tabList.find("a.on").removeClass("on").attr('href')).hide(); $($tabList.find("li.active").removeClass("active"));
var $newTab = $($(this).addClass('on').attr('href')).show(); $(this).closest('li').addClass('active');

Share this post


Link to post
Share on other sites
added this to line 442 so I can change the icons in the tree to indicate pages with children

You might be able to avoid a core modification here, because the markup already has identification for children (which is how the PageList js knows it has children). The presence of a span.PageListNumChildren as a child of any .PageListItem indicates that a page has children. Lets say you wanted to add that "hasChildren" class to all items that had children:

$(".PageListNumChildren").each(function() {
 $(this).parent(".PageListItem").addClass("hasChildren"); 
}); 

You can also target the .PageListNumChildren span directly with CSS, as this is what contains the numbered quantity of children in its text.

Let me know if this doesn't solve it, I don't mind adding another class here if it helps.

  • Like 1

Share this post


Link to post
Share on other sites

As for JqueryWireTabs, I'm willing to, though reluctant to put CSS framework-specific classes in the code for these modules. I'm thinking what might be better here is for the theme's JS to populate those framework-specific classes, like this:

$("ul.WireTabs").addClass("nav-tabs").find(".on").addClass("active");

An even better option may be to update the CSS framework class names to include alternate versions. This is the approach I've taken on some other projects. I thought this was better than modifying other kind of code because stylesheets are supposed to be kind of the last stop and we use them to style output rather than the other way around. For instance:

.nav-tabs .on <!-- add this line -->
.nav-tabs .active {
  ...
}

Share this post


Link to post
Share on other sites

This looks absolutely fantastic Michael. Will you be releasing this to the big bad world when you're happy with it?

It really looks like a great workflow for the editor!

Share this post


Link to post
Share on other sites

Think I may end up giving this a go but probably will use Foundation instead as I find it just a little more flexible, pretty much the same end result though.

Just need to find a few days free time ;)

Any news on Michael? Seemed onto a good thing here... 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...