Richard Jedlička Posted December 16, 2021 Share Posted December 16, 2021 Hi I created new module for adding links to quickly edit a field directly from page edit. https://processwire.com/modules/admin-helper-links/ You probably already know existing module HelperFieldLinks created by @Soma which was my inspiration. I was using that module for a long time so thank you @Soma! The reasons for this new module are that HelperFieldLinks seems inactive and contains few bugs. I decided to try to fix them, but after a short time I realized a better (i think) and simpler solution and also got some new ideas how to improve. I used javascript instead of PHP and modified a code which is already in PW source code to show field names when you hover the inputfield's expand arrow (in debug mode). I also moved the cog icon next to the expand icons which doen't break the layout so much. What is missing is the field info panel with it's props, never used it, but it can be done too. The template edit links needs to be added too. If you got some ideas how to improve, tell me. 10 1 Link to comment Share on other sites More sharing options...
szabesz Posted December 17, 2021 Share Posted December 17, 2021 Hello, Thank you for sharing your module. I used to install AdminOnSteriods on all of the sites I work on, which module (among lots of other features) can do the same. However, since AdminOnSteroids might not be maintained in the future, I started not to use it. What I am really missing without AdminOnSteroids is this feature you implemented, and a similar one, which is a link to the edit template page. So my first idea to improve the module would be to add an "Edit template: templatename" link next to the title of the page (H1 id="pw-content-title" in the html source of the page). BTW, I installed it and the cog icon does not show up, because you hardcoded the admin url into the module. Could you please us $pages->get($config->adminRootPageID)->url instead? Yeah, it involves PHP, but: https://processwire.com/talk/topic/8343-access-page-and-pages-variables-from-inside-a-javascript-file/ Or maybe some knows that the admin URL is already provided by the PW admin on the JavaScript side as well? 1 1 Link to comment Share on other sites More sharing options...
Richard Jedlička Posted December 17, 2021 Author Share Posted December 17, 2021 Hi @szabesz, thanks for your reply. I will, hope, add the template edit link soon. Yeah I hardcode the url, I didn't realized it can be changed, will fix it. 1 Link to comment Share on other sites More sharing options...
bernhard Posted December 17, 2021 Share Posted December 17, 2021 6 hours ago, szabesz said: Thank you for sharing your module. I used to install AdminOnSteriods on all of the sites I work on, which module (among lots of other features) can do the same. However, since AdminOnSteroids will might not be maintained in the future, I started not to use it. What I am really missing without AdminOnSteroids is this feature you implemented, and a similar one, which is a link to the edit template page. Same here 🙂 So thx for you module! @szabesz you know that tracy shows the template in the panel (and it's a link) @Richard Jedlička you can add uk-tooltip attribute then AdminThemeUikit will show the title="foo" as nice tooltip on hover 🙂 2 Link to comment Share on other sites More sharing options...
szabesz Posted December 17, 2021 Share Posted December 17, 2021 38 minutes ago, bernhard said: you know that tracy shows the template in the panel (and it's a link) Thanks, since it is not so intuitive to look there (and AOS has probably spoiled me, and I often hide/disable Tracy anyway...) I keep forgetting it. Also, I do not work on PW projects these days too much, so my memory is fading, but I'm trying to keep it fresh by reading all the forum posts that look "interesting". Side note: I could have just implemented my own module like this one as it is not rocket science to do it but I do not have free time these days I'm afraid, so I am happy to see that someone deals with these features, and puts those links into the positions where l would look for them. Link to comment Share on other sites More sharing options...
Richard Jedlička Posted December 17, 2021 Author Share Posted December 17, 2021 Version 1.1.0 is here. - added template edit link - added link for editing field in template context - using modals - style update: changed link icons, field name, tooltips, ... 4 Link to comment Share on other sites More sharing options...
donatas Posted December 29, 2021 Share Posted December 29, 2021 Thanks @Richard Jedlička, seems like a very useful module! One thing I would love to be able to do is to limit use of these links by user roles. I'm not sure I want some adventurous clients changing something I don't want them to 🙂 In my opinion custom permission/role would be best for this. However sometimes I make client users "superusers" too, so it would be best to be able to disable/enable links for some superusers only. Do you think it's possible? Thanks! Link to comment Share on other sites More sharing options...
Richard Jedlička Posted December 29, 2021 Author Share Posted December 29, 2021 Hi @donatas, ah there is already a permission associated with a module, and I thought it will work, but looks like not. Maybe it works only for process modules out of the box. I will check it. Link to comment Share on other sites More sharing options...
Richard Jedlička Posted December 29, 2021 Author Share Posted December 29, 2021 It is fixed in verion 1.1.2, add a admin-helper-links permission to a role. 2 Link to comment Share on other sites More sharing options...
wbmnfktr Posted December 29, 2021 Share Posted December 29, 2021 This is such a nice addition. Didn't know I need it but now. Thanks @Richard Jedlička! 1 Link to comment Share on other sites More sharing options...
donatas Posted December 29, 2021 Share Posted December 29, 2021 48 minutes ago, Richard Jedlička said: It is fixed in verion 1.1.2, add a admin-helper-links permission to a role. Works perfectly! Super thanks! 1 Link to comment Share on other sites More sharing options...
Stefanowitsch Posted December 30, 2021 Share Posted December 30, 2021 I find this module really useful. Editing a template directly from the page it is using saves a lot of time. Link to comment Share on other sites More sharing options...
Richard Jedlička Posted January 6 Author Share Posted January 6 New version 1.1.5 I've fixed issue with editing in repeater's template context https://github.com/uiii/AdminHelperLinks/issues/1 and disable focus on tab press (was annoying when switching focus between inputs). 2 Link to comment Share on other sites More sharing options...
bernhard Posted January 14 Share Posted January 14 Hi @Richard Jedlička there's one slash too much on line 134 🙂 PS: If it is easy to implement a "save + reload" button would be nice to have in the modal 🙂 Link to comment Share on other sites More sharing options...
Richard Jedlička Posted January 14 Author Share Posted January 14 1 hour ago, bernhard said: there's one slash too much on line 134 Ah ok, will fix it, does it make any problems (just curious)? 1 hour ago, bernhard said: If it is easy to implement a "save + reload" button would be nice to have in the modal You mean to reload the page edit after you update the field? Yeah it will be useful. If you have time PR's are welcomed 🙂 Link to comment Share on other sites More sharing options...
bernhard Posted January 14 Share Posted January 14 31 minutes ago, Richard Jedlička said: Ah ok, will fix it, does it make any problems (just curious)? Yes, the link does not work on my DDEV environment 😉 Link to comment Share on other sites More sharing options...
bernhard Posted March 11 Share Posted March 11 Hey @Richard Jedlička thx for the really helpful module 🙂 Would it be possible to add icons to fields that have no label? Eg a checkbox. Ideally the icon would appear in the top right corner: 1 Link to comment Share on other sites More sharing options...
Richard Jedlička Posted March 11 Author Share Posted March 11 4 minutes ago, bernhard said: Would it be possible to add icons to fields that have no label? Hi @bernhard, yes, I have it already in my backlog 🙂 Hope I will find a time for it soon. 1 1 Link to comment Share on other sites More sharing options...
bernhard Posted May 17 Share Posted May 17 Hey @Richard Jedlička just wanted so say thank you as your module is really helpful in my daily work 🙂 Also thank you for your suggestions regarding RockMigrations field context syntax, I'm using that all over and it makes the migration syntax a lot better!! 😎 2 Link to comment Share on other sites More sharing options...
Richard Jedlička Posted May 17 Author Share Posted May 17 @bernhard Hi, I'm happy to hear that ☺️. Sorry, I still haven't fixed the labelless fields. I'm in a focus on other projects right now (non pw-related). 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now