Jump to content

FireWire

Members
  • Posts

    475
  • Joined

  • Last visited

  • Days Won

    31

Everything posted by FireWire

  1. Hey everyone, I'm pretty experienced with pagination and haven't seen this before. I have my pages pulled using $pages->find, which is working fine however using renderPager() generates pagination where the links do not work. Here are some details. All templates needing pagination have pagination enabled in the admin. URL Segments are not enabled. Clicking on the "Next" or numbered links merely reloads the current page. The link href values are properly being output with the urls being /page2, /page3, /page4, etc. Manually entering the paginated urls has the same effect of reloading the current page with no new content. Pages are being returned from the ->find function properly and with the proper limit. A few other details: ProcessWire v3.0.98 Multi-language is enabled, 2 languages implemented. Pagination does not work on either language Have very few modules installed (few enough to list), none of which I could see interfering: ProFields, ProDrafts, ListerPro, DB Backups, Cronjob DB Backup, Upgrades, Upgrade Checker, Force Password Change, Markup Sitemap XML I'm stumped. For the sake of being overly-thorough, here's the code: <?php $articleTemplates = [ 'template_news_article', 'template_news_video', 'template_news_press_release' ]; $searchParams = [ 'template=' . implode('|', $articleTemplates), 'sort=-published', 'limit=' . $pages->get('template=template_news')->list_count ]; $articles = $pages->find(implode(',', $searchParams)); echo $articles->renderPager(); ?>
  2. 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.
  3. 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/
  4. 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!
  5. 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!
  6. 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.
  7. 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!
  8. 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.
  9. 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.
  10. 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!
  11. 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.
  12. 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.
  13. 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.
  14. 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?
  15. 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!
  16. Thanks. Will do. I wasn't too far into building out the cms so I started over. It does seem like ProDrafts would be the most likely culprit.
  17. I've done many PW sites never an issue really an odd bug. Running a Docker instance with PHP7 & MariaDB 10.
  18. Can't find anything out of the ordinary and the file shows up in the page assets file.
  19. I'm checking and don't see anything out of the ordinary with respect to the other data around it. Then again I'm not 100% sure what to look for.
  20. I don't believe so. I also downgraded to 3.0.76 just in case updating the core created an issue. Here is a list of my modules: FieldtypePhone FieldtapeRepeaterMatrix FieldtypeSelect FieldtypeTable FieldtyupeTextareas InputfieldCKEditor MarkupSEO MarkupSitemapXML PageEditSoftLock PageListShowPageId PasswordForceChange ProcessDatabaseBackups ProcessPageDelete ProcessRedirects ProcessWireUpgrade ProDrafts TemplateNotes TextformatterAutoLinks VersionControl
  21. Hey everyone, I have an images field that is located within a Fieldset in Tab. When I add images it appears to upload them but when I publish the page they disappear. Here are some more details. The images are actually added (uploaded) to the page's asset directory but don't show up in the admin and aren't accessible from the API. Moving the field to the Content tab does not show the previously uploaded images, but it does allow you to add/upload images and they appear correctly. If you've entered images on the Content tab and move the field back to the other Fieldset in Tab, the images entered on the Content tab remain and are accessible via the API I've set and unset options for size requirements, for it's Formatted output value, etc. I have deleted the field, created a new one, and added it back to the tab- same issue. Basically tried everything I can think of and haven't run into this before. *Update* - Just found that the field doesn't work inside a regular Fieldset either. I'm out of ideas. Running PW v3.0.77
  22. @Soma you have just saved me. Thank you.
×
×
  • Create New...