Jump to content

adrian

PW-Moderators
  • Posts

    11,174
  • Joined

  • Last visited

  • Days Won

    371

Everything posted by adrian

  1. Thanks for the subfolders - much better for complex tweaks, especially those that require additional assets like the AOS column break I just ported over. I know about admin.less and I do use it. I guess I kinda of forgot in this context because I've been loading an admin.css via AOS for my standard tweak for so many years now.
  2. Sorry :) I'll leave @jploch to answer that, but I think the request for these arrows is in the spirit of making editing children easier in general from the main Content view.
  3. @ryan - the arrows after the page title in Bernhard's screenshot above is what is being referred to.
  4. Hey @bernhard - I am thinking of revisiting this module now that it seems to be getting some traction but have two questions before I start pulling out the key things from AOS that I need. 1) What about having subfolders for each tweak so that we don't end up with a mess of php, js, css files for multiple tweaks in the one categorizing parent folder? 2) I am also thinking about a replacement for AOS's Assets Paths > Admin CSS and Admin JS feature. Perhaps it's a simple matter of creating a custom local tweak that just calls loadCSS() and and loadJS() for all those random tiny tweaks that are small enough and don't need a specific hook (and therefore PHP file). Any thoughts? Thanks.
  5. @jploch - this is a feature that AOS has which I enable it on all sites - very handy indeed, as is of course BreadcrumbDropdowns.
  6. Then we could use the system "published" property, no? Regardless, even if there is a need for a custom date field of some sort on the post template, that could still drive that getRaw() example I posted. Not saying it's the right way to go - just highlighting some other options.
  7. You could also simply get the parent by using the parent property. Of course you don't need to use setAndSave() but I feel it's cleaner in a situation like this. I also like using $p rather than $p because even though the scope will prevent $page from overwriting the PW $page object, I still find it less confusing, but that's just a personal preference. $wire->addHookAfter("Pages::published(template=post)", function (HookEvent $event) { $p = $event->arguments(0); $blog = $p->parent; $blog->setAndSave('date_modified', $p->date_modified); }); Also, in case you don't know, there is a system "modified" property rather than adding a separate custom field for that. Another thought - if updating the modified date for the blog parent is just about using it to display on the website, perhaps you can just get the modified date of the most recently modified post, eg:
  8. @ryan - I wonder if PW might automatically include those gc tweaks when Debian is detected? Maybe via something like this. Perhaps it could be run at install, rather than runtime if you're concerned about performance although it is only about 1ms. if (strtolower(substr(PHP_OS, 0, 5)) === 'linux') { $vars = array(); $files = glob('/etc/*-release'); foreach ($files as $file) { $lines = array_filter(array_map(function($line) { // split value from key $parts = explode('=', $line); // makes sure that "useless" lines are ignored (together with array_filter) if (count($parts) !== 2) return false; // remove quotes and new lines $parts[1] = str_replace(array('"', "'", "\n"), '', $parts[1]); return $parts; }, file($file))); foreach ($lines as $line) { $vars[$line[0]] = $line[1]; } } d($vars['ID']); }
  9. If you're running Debian, try adding this to your config.php /** * Enable Session Garbage Collection * Garbage Collection is disabled in Debian as default (probability set to zero) * Enable session garbage collection with a 1% chance of running on each session_start(); * Chance calculated as gc_probability/gc_divisor * Session path is defined inside wire/core/Session.php and points to site/assets/sessions * Thanks to this modification session now takes into account gc_maxlifetime set in config */ ini_set('session.gc_probability', 1); ini_set('session.gc_divisor', 100);
  10. @ryan - I need it for coupon codes which are stored underneath categorizing branch parents, but which are accessed by end users via a urlsegment on the home template. I have been using a hook to ensure duplicates can't be accidentally created and that works fine so not critical that this is added for my needs but just wanted to see if you thought it was still something that should be added to the core.
  11. Lots more Adminer updates in the last couple of weeks, but the key things are: 1) Shift-click on the DB icon links will now open Adminer in full mode rather than with the Tracy panel 2) Page, template, field, etc ID within Adminer table views are now linked - note the page title (and path) and the link to edit that page - this comes from hovering on any of the id, parent_id, templates_id, created_users_id, modified_users_id, etc. These sorts of links are present throughout including linking to modules from the "modules" table, hanna_code, pages_meta, etc. It also works for all Page Reference field's page IDs in Profields Table "field_table" tables, Profields Combo, repeater, RM fields, etc. Hopefully you'll all find this as useful as I am.
  12. @ryan - just following up on the comment by @Denis Schultz - now 4 years on, are you still planning on adding that "Unique" checkbox for Text and Integer fields?
  13. Ryan has always done this (I really don't know why), but the tag on GH is added for the previous master version when the next master version is released and made available from the PW site's download page.
  14. Also another possibility - are you running Debian? If so, I find I have the same issue unless I add this to config.php /** * Enable Session Garbage Collection * Garbage Collection is disabled in Debian as default (probability set to zero) * Enable session garbage collection with a 1% chance of running on each session_start(); * Chance calculated as gc_probability/gc_divisor * Session path is defined inside wire/core/Session.php and points to site/assets/sessions * Thanks to this modification session now takes into account gc_maxlifetime set in config */ ini_set('session.gc_probability', 1); ini_set('session.gc_divisor', 100);
  15. Thanks for the explanations. I actually use strtr quite a lot for an array of substring replacements - works great. Sorry for the confusion about how it replaces - I wasn't thinking straight and was thinking about this difference: "strtr will not replace in parts of the string that already have been replaced - str_replace will replace inside replaces", rather than the replacing only the first occurrence - sorry I rushed without thinking it through - my bad :(
  16. @Michael Lenaghan - I am curious - did you find an issue with strtr or just went with Laravel's approach without looking into it? Not a criticism at all, just want it to be a learning experience for all of us if you did find an issue.
  17. Maybe "strtr" instead of "str_replace" would take care of things as it only replaces the first instance. I am surprised though that it's not mentioned at all here: https://stackoverflow.com/questions/1252693/using-str-replace-so-that-it-only-acts-on-the-first-match so maybe I am missing something? Perhaps this is worth a thorough read: https://stackoverflow.com/questions/8177296/when-to-use-strtr-vs-str-replace
  18. Checking all 3 of these will probably do what you want, but I actually never use the second two because I make use of the "Enable Guest Dumps" button from the panel selector. Enable that, do what you need to do as a guest in a private window and then reload the PW admin where you are logged in as a superuser and you'll get the dumps recorded by the guest. Another thing is to make sure you have the "Tracy Exceptions" panel enabled so that if a guest user interaction results in an exception, the bluescreen with full stack trace will be made available for easy viewing. I rely on this for all my sites with Tracy's production mode. Hope that helps.
  19. Weird - maybe you had just never saved the settings so the format wasn't available? Anyway, shouldn't matter now regardless.
  20. Hi @AndZyk - you don't need to select an output format - none is perfectly valid (it's basically "unformatted"). That said, I have fixed the error if for some reason you decide to empty the options textarea. PS - it's worth figuring out the syntax- I know it looks a bit overwhelming at first, but it's really powerful and keeps your template code much cleaner.
  21. Yep, running 0.1.1 Any chance you could post this on a live site somewhere you could give me a superuser login to test it out for you?
  22. Would you mind uninstalling and reinstalling Tracy and see if that takes care of things please?
  23. Hi @olafgleba - I just tried a table field in repeater matrix and it looks ok here so I really don't know what's happening at your end I am sorry. Maybe a conflict with one of the other fields in the RM field? Does it work with only a table field in the RM field? Perhaps you can start with the simplest example of just a table field in a RM field with nothing else and if that works try to figure out what it breaking it. Sorry I am not much help :)
  24. Sorry, it's the Debug Mode panel - in the Cache section.
×
×
  • Create New...