Jump to content

Admin Custom Files


Martijn Geerts

Recommended Posts

  • 2 weeks later...

Refresh listerPro after closing/saving the modal:

(You need to enable 'Additional javascript config data' in the settings)

$(function () {
    if (config.AdminCustomFiles.process === 'ProcessPageListerPro') {
        $(document).on('dialogbeforeclose', '.pw-modal-window', function() {
            $("#_ProcessListerRefreshTab").click();
        });
    }
});
  • Like 3
Link to comment
Share on other sites

  • 2 months later...

if you want to make icons searchable (when setting them on a template), you can use chosen select..

1) add chosen min.css, min.js and sprites in AdminCustomFiles folder.

2) enable ProcessTemplate in the ACF module settings

3) add lines to load chosen assets (in the dependencies box)

ProcessTemplate AdminCustomFiles/chosen.min.css
ProcessTemplate AdminCustomFiles/chosen.jquery.min.js

4) create processTemplate.js, inside AdminCustomFiles folder

$(document).ready(function(){	
	
  $("select#Inputfield_pageLabelIcon").chosen({
    	disable_search_threshold: 10,
	no_results_text: "Oops, nothing found!",
	width: "25%"
  });
	
});

this will probably end up being a module, so that it can also extend to fields; for now if you want to do it on fields you have to repeat the instructions for ProcessField and also change the jquery selector

  • Like 3
Link to comment
Share on other sites

  • 2 months later...
  • 1 month later...
  • 1 month later...

here's a quick way to change the slider increment for your date timepicker, (this would go in AdminCustomFiles/ProcessPageEdit.js):

if(typeof $.timepicker != 'undefined') {
    $(function(){
        $.timepicker.custom = {
            stepMinute: 15,
        };
        $.timepicker.setDefaults($.timepicker.custom);
    });
}

if you run the latest version of timepicker addon (1.6.1) you can use selects instead of sliders:
(for example if you are on current dev/stable, you copy the inputfield to site/modules and tell the system to use that one; then upgrade to the latest timepicker, and copy the new css to the datetime css; if are on devns, word is that it will include the latest version of timepicker).

if(typeof $.timepicker != 'undefined') {
    $(function(){
        $.timepicker.custom = {
            stepMinute: 15,
            controlType: 'select',
            oneLine: true,
        };
        $.timepicker.setDefaults($.timepicker.custom);
    });
}
Edited by Macrura
check for timepicker to prevent js error
  • Like 4
Link to comment
Share on other sites

  • 1 month later...

just a easy one...as a little christmas present.

My clients sometimes have problems to find the view link... ;)

so here some example CSS for ProcessPageEdit.css in /templates/AdminCustomFiles/

#content .WireTabs #_ProcessPageEditView {
  color: #69b023;
  font-weight: bolder; }
#content .WireTabs #_ProcessPageEditView:before {
  display: inline-block;
  font: normal normal normal 14px/1 FontAwesome;
  font-size: inherit;
  text-rendering: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transform: translate(0, 0);
  content: "\f06e\00a0 "; }
#content .WireTabs #_ProcessPageEditView:hover {
  background: none;
  text-decoration: underline;
  border-color: transparent; }

using BernhardB 's famous giphy tool it looks like:

post-2327-0-17706700-1451081437_thumb.gi

(just a example with fontawesome and bold to get the idea)

regards mr-fan

  • Like 4
Link to comment
Share on other sites

  • 4 weeks later...

Can Admin Custom Files be a solution for my problem?

Please see https://processwire.com/talk/topic/2074-module-page-edit-field-permission/?p=110990

Users with a restricted role now only can edit 2 fields of a repeater item. But they can remove or add repeater items.

I need to hide both "functionalities" with css (or another solution), only for this page with a specific template and when a user with this role is logged-in.

Thank you in advance

Edit: in this particular case, as this role can only edit pages with this template (that is only for these pages) now, the condition could be only when this role is logged-in.

Link to comment
Share on other sites

Thank you Martijn for the information.

I've had a solution starting here: https://processwire.com/talk/topic/2074-module-page-edit-field-permission/?p=111207

But now I have another problem :/. https://processwire.com/talk/topic/2074-module-page-edit-field-permission/?p=111223 **

All of a sudden another issue has appeared (I don't know if it's related in a way or not at all).

Now when I log-in as the "manager" user (not the superuser), I don't have access anymore to the page(s) tree and to the users ("membres" role) that I could add or edit.

When I click on the Users link I have the following message (translated):

ProcessWire: You don't have permission to execute this module - ProcessPageLister

I don't understand what has happened...

** I have added attached images.

Edit: it's apparently due to Admin Restrict Branch. I have to find why, as it worked well before and I only restricted a Specified Branch Parent for the "Membres" role.

Link to comment
Share on other sites

Edit: it's apparently due to Admin Restrict Branch. I have to find why, as it worked well before and I only restricted a Specified Branch Parent for the "Membres" role.

Just wanted to wrap this up and let folks know that the problem that @Christophe discovered with AdminRestrictBranch has been fixed.

  • Like 2
Link to comment
Share on other sites

Taken from AdminThemeReno, but I think credit actually goes to Nico:

.content .PageList .PageListItem:hover .PageListActions{display:inline;-webkit-transition-delay:.25s;transition-delay:.25s}
.content .PageList .PageListItemOpen .PageListActions{display:none !important;}
.content .PageList .PageListItemOpen:hover .PageListActions{display:inline !important;-webkit-transition-delay:.25s;transition-delay:.25s}

I added the other two lines to hide links on an open parent

hmmm... i thought there was an option for this in the core recently but can't find where. or have i been dreaming?! :)

Link to comment
Share on other sites

hmmm... i thought there was an option for this in the core recently but can't find where. or have i been dreaming?! 

Yep - hover links are now default in the core although it can be disabled with a config setting: https://processwire.com/blog/posts/processwire-core-updates-2.5.26/#pagelist-now-supports-hover-actions

They do work a little differently in the core than with that custom css. In the core you have to mouseover the Title of the page, but with that CSS you can mouseover anywhere on the line which I actually prefer.

  • Like 1
Link to comment
Share on other sites

thank you adrian - i know i wasn't dreaming!

that's really strange because recently i discovered that i don't see some site elements that should be there. thats not related to processwire. don't know where this comes from, its only on my new laptop with touchscreen. i also do not see pagelistactions on hover... it only works on firefox, not on chrome and IE :(

but thats offtopic here and i will investigate when i have more time...

Link to comment
Share on other sites

Again and again i've to write how awesome this module works....thank you Martijn.. ;)

it's a kind of JS/CSS captain hook for the admin!

Here a little example for a easy solved problem at least for me:

Have a events page that works like a timeline - and the event template itself contains the data and provide a .ics format file on the URL of the "page" there is no kind of single view and the template works as iCal generator for the event itself. So the little big Problem is if a user/autor clicks in the backend on "View" he get the eventxyz.ics file and not to the frontend page for the events.... ;) so i need one line in the PageProcessEdit.js that solves this issue with a breeze of jquery.

    $("a#_ProcessPageEditView[href*=events]").attr("href", "/event-overview-page/");

best regards mr-fan

  • Like 1
Link to comment
Share on other sites

  • 10 months later...

A brand new AdminCustomFiles!

That's what I have, but it's NameSpaced, and I'm not keen to make it compatible with ProcessWire2.8 or lower. Essentially it looks like the same Module, but it's rewritten, nothing of the old have survived, although all features work foor 99% the same.

I don't want to loose the name, but don't want the older version gets lost. So, now I'm in trouble I'm not sure how bring this version up to the public. 

What do you guys think... Should I zip the old and put it in to the Module, of create a new Name...

  • Like 3
Link to comment
Share on other sites

  • 1 month later...

The module injects broken links.

My main localhost url is: http://localhost/mysite.com/ and the module injects the css link as:

<link type='text/css' href='/site/templates/AdminCustomFiles/ProcessPageEdit.css' rel='stylesheet' />

where the correct one should be:

<link type='text/css' href='/mysite.com/site/templates/AdminCustomFiles/ProcessPageEdit.css' rel='stylesheet' />

 

Link to comment
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
×
×
  • Create New...