usualCommission

Members
  • Content count

    48
  • Joined

  • Last visited

Community Reputation

15 Good

About usualCommission

Recent Profile Visitors

624 profile views
  1. I did see that and I tried it out in the past, I just couldn't get past the 24hr format entry and the clock entry method, I know that will be an issue with the client as well. This was a fast and easy way to get a picker that matches the datetime entry field. I really wish there was a native way to do that- it makes for a cleaner look for the user. Also looks really good in the new uikit theme.
  2. I've run into this need a few times and decided to take a crack at it. I am doing a custom calendar and really needed to get this time field and I'm on a deadline. I have a solution- albeit a little quick and dirty, but it works well for my project. I've only played with this in the new AdminThemeUikit admin interface though and do not know if it works in previous versions of PW. This is similar to the solution above but with no dependency on the Admin Custom Files module. I created a file called pw_admin_timefield.js and put it in site/templates/admin/ to keep it organized from the site's code. Inside that file I added this: $(function() { if ($.fn.timepicker) { $("input[name*='_time'").timepicker({ controlType: 'select', oneLine: true, timeFormat: 'h:mm TT', stepMinute: 5 }); } }); Checking for the existence of that function is a requirement as it is not loaded on all admin pages and will prevent the page from rendering properly. Since this isn't integrated as a true module these settings dictate how the time select will render every time. The timepicker plugin included with PW is here at this link and has all documentation for configuration: http://trentrichardson.com/examples/timepicker/ In the site/templates/admin.php file I added these two lines: $modules->get('JqueryCore'); $config->scripts->add($config->urls->templates . 'admin/time_field/pw_admin_timefield.js'); If the JqueryCore module is not called you will get the $ not defined JS error. Whenever I need a time select field with no date I create a text field with a suffix of "_time" on the end of the field name which matches the jQuery selector above. So my calendar has event_start_time and event_end_time and they both get time-only pickers. This would be much better as a module with the level of configuration that the Datetime field has. I might work on doing that next, but in the meantime this immediately solved the problem I had quickly. Thanks to @Soma for this article on custom JS in the admin: http://soma.urlich.ch/posts/custom-js-in-processwire-admin/
  3. After you had started to explain the use of the users directly rather than the pages I began thinking in that direction as far as the URL segments go and I just read about the login-disabled role a couple of days ago but didn't think of that use case until you mentioned it. That very well may have swayed me away from building this module. Unfortunately in my case we haven't updated our core yet and we're still back on a .6 version. We're upgrading to the latest with our next feature push so I'm pretty stoked about that. Your method is really solid and I am very sure I'm going to run into places I can use that. Building page references with better selectors opens up a ton of possibilities. Thanks for the explanations and help- I really appreciate it!
  4. Creating the extra pages allows for a page select field to be generated so a specific user with a blog-author role can be chosen to override the blog post creator. I wanted this to be more static/persistent than drawing from the list of admin user pages directly in case at some point a person is removed completely from the CMS we won't be trying to reference someone that isn't there anymore and create an issue with blog posts that have been published before that. A bonus to having a page generated from the user is the ability to have an author page available at say "blah.com/blog/authors/john-example" where I can show a page on the site displaying all the blog posts by John Example (and his ghost writer). Then let's say John Example leaves the company and his user is removed from PW completely, the page structure and all of the page references are intact with no user attached to them. We won't have guest authors per se, just real authors that need to write posts and sometimes be attributed to other posts. I think I get your solution but I don't know if I'm making the connection well enough to understand if it satisfies my scenario. Absolutely interested in your explanation. I also need to get more familiar with the selector string for page reference field. It's great!
  5. That modal module looks great. I'll play around with that. The method you described was my original approach as well- it would definitely fit within the blog use scenario. After I met with the team we decided that we wanted to have it both ways. More specifically- at my company we will have many people contributing to the blog so they do need access as blog authors to write posts, however there will be other people helping write more than others. There will be times that they will have to post as someone else so going by the creator of the page won't work since that can't be changed unless they are a superuser and that's not possible for our system. Basically, there's a site-manager role for a person who does a lot of copy writing but may need to contribute as someone else. If a blog author contributes that's great, otherwise if a site-manager posts for them they can override the author since the page creator won't be the author we need. My module tries to solve this by always having a page under authors like you had described while still allowing the authors to log in and blog as they need.
  6. Hi everyone. I just completed first draft work on a module that I wrote. It creates a page for a user with a specified role when a user admin page is saved. I'm sure it could use some more work and would like any feedback on implementation, code quality, and any better utilization of the PW API. The problem I aimed to solve is that we are using the fantastic MarkupBlog module and wanted a way to easily specify an author for a post when the person who created the page is not the author we want shown on the post (example: one blog author ghostwriting for another blog author). This module allowed me to create a blog-author role and on user admin save create a page under the "Authors" page in the tree. After that each blog post gets a page select field that lists the Authors page children for selection. More detail: If a user is deleted from the CMS, their page remains in the page tree. This is to prevent problems if there are other pages that depend on that page. A hidden field is added to the User admin page that holds the id for the page created. When creating a page for a user, it checks if there is a page already created with that user's name- if it is, that page is used and the hidden field is updated with that page's ID. If a user's page is deleted from the tree, a new page is created on user admin save and the hidden ID field is updated with the new ID. Module installs and uninstalls properly including adding and removing the hidden ID field from the User system template. The module settings allow for choosing more than one role to create pages. Again since this is my first rodeo with ProcessWire module development I would love feedback and critique. The code is available here: https://github.com/skylundy/AutoUserPages Thanks!
  7. Is there a way to give this permission to non-superusers? I'd like to have a person ranked below a superuser to have this capability as well.
  8. The culprit is ProDrafts. As soon as that was installed the image field started malfunctioning if it is outside of a FieldsetPage. So the FieldsetPage in PW version v3.0.77 and the current latest ProDrafts module v0.0.6 conflict.
  9. Yeah I am working on localhost with a fresh install but may have missed testing. This was more on me for not being more thorough. The DB Backups is a go-to as it makes keeping a backup of the DB in the file system fast and reliable while keeping it inside the Git repo I'm working on. Helps coordinate the entire state of the code & CMS in one commit. @adrian I will look into those- good suggestion!
  10. Alright. I re-stripped everything and it works. I'm going to go by one by one and test each module until I find the culprit. Will post if/when I can nail that down.
  11. I did do that when I reinstalled to the latest dev. The only non-default module I have installed besides that is DB Backups so that I can jump around and test without losing info or work. I am trying again now.
  12. My issue is that if a FieldsetPage is within the same tab as an image field, the image field won't upload. The image field is outside of the FieldsetPage. If my image field is inside a FieldsetPage, it works fine like yours does.
  13. I'm out of ideas... installing/uninstalling that module made the difference for me. Is there anything else that could be doing it? A combination of things?
  14. Final Update: I reinstalled 3.0.77 and went module by module. The issue is caused by using the new Fieldset (Page) module. I was really looking forward to using this new feature. Unfortunately enabling that module has an effect on image fields within tabs. I was using a Fieldset (Page) field in the same tab however moving it outside of that tab group did not solve the issue. Something that still has to be worked on I guess. Can also confirm that by uninstalling this module, the issue disappears. Bummed. This Fieldset (Page) module looks fantastic. Thanks everyone for their help!