Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/16/2018 in all areas

  1. Several core updates this week including a new way to perform $pages->find() searches by using Field tags, a new Field tag manager, new methods added to our $input API variable, new Inputfield traversal methods, and more… https://processwire.com/blog/posts/pw-3.0.106/
    2 points
  2. Moderator Note Following @Jonathan Lahijani's request, the WordPress vs. ProcessWire videos have moved to their own topic here.
    2 points
  3. A hook for anyone still wanting a solution for this: // Prevent the trashing of pages referenced by other pages $pages->addHookBefore('trash', function(HookEvent $event) { $page = $event->arguments(0); // Find non-system Page Reference fields $pr_fields = $this->fields->find("type=FieldtypePage, flags=0"); // Implode for selector string $pr_fields_str = $pr_fields->implode('|', 'name'); // Find any referencing pages $referenced_on = $this->pages->find("$pr_fields_str=$page->id, include=all"); if($referenced_on->count) { // Replace the trash method $event->replace = true; // Link markup for referencing pages $referenced_on_str = $referenced_on->implode(', ', "<a href='{editUrl}'>{name}</a>"); $plural = $referenced_on->count > 1 ? 's' : ''; // Trigger an error message (using $session in case a superuser is trashing from ProcessPageList) $this->session->error("You cannot trash page $page->name because it is referenced in a Page Reference field on page$plural $referenced_on_str.", Notice::allowMarkup); // Don't allow the trashing of this page $event->return = false; } }); When attempting to trash a referenced page from ProcessPageList the page will at first appear to be trashed but in fact it is not, and on the next admin page load a notice will be displayed explaining the situation. I don't think this detail matters much because it only affects superusers.
    2 points
  4. Hi @ryan, The new field tag features are cool, thanks! It's not quite the same, but in some ways being able to use a different name (tag) to refer to a field in a selector is similar to a request I raised a while ago about an idea for field aliases. So for example if I have a field with a generic name like text_1, when it is in my employee template I can use it in my template file and selectors as first_name. That would help a lot with code readability and encourage more efficient field re-use. Could the new field tag features be leveraged in some way to add support for field aliases? Probably as a separate thing to tags, but perhaps building on some of the same code you added this week?
    2 points
  5. There are no guarantees that Gitlab or any other providers won't do that either. If people are afraid of snooping, they shouldn't check-in code to a 3rd party provider in the first place.
    2 points
  6. That's right, field names have precedence, and it also warns you if you try to create a tag that collides with a field.
    2 points
  7. Last update: June 2024 Current stable version: 1.5.4 Dev version: github dev-branch You can find the module on Github and in the modules directory : https://modules.processwire.com/modules/duplicator/ https://github.com/flydev-fr/Duplicator/archive/master.zip Screenshots / Features Dir and files exclusion CRON job Advanced settings Local and Cloud storage duplicator.mp4
    1 point
  8. LogMaintenance A simple ProcessWire module to give some maintenance control over log files. I found myself often having lots of log files for different things that can grow more or less quickly to a size where they can be difficult to maintain. The built in Logger of PW does a good job of giving you the possibility to delete or prune logs. But it has to be done manually and sometimes a log grows into millions of lines, which makes it often impossible to even prune it as it's too large. LogMaintenance uses LazyCron to run the maintenance task and there's several settings you can setup on a global or per log basis. Archive: will create zip files for each log file in logs/archive/ folder and add the log each time the maintenance is run to a subfolder containing the datetime. Lines: keeps logs to a certain number of lines Days: keeps the log to a certain number of days Bytes: keeps the log to a certain amount of bytes Each setting is checked from top down, the first setting to contain something is used. So if you check the "Archive" option, all other settings are ignored and logs are archived everytime the LazyCron is executed. If you want to keep your logs to a certain amount of bytes just leave all other settings to 0 or blank. Per Log Settings There's a textarea that you can use to setup a config for a specific log file one per line. All the logs you define here ignore the global settings above. The syntax for the settings is: logname:[archive]:[lines]:[days]:[bytes] errors:1:0:0:0 // would archive the errors log messages:0:10000:0:0 // will prune the errors log to 10000 lines The module can be found on github for you to check out. It's still fresh and I'm currently testing. https://github.com/somatonic/LogMaintenance
    1 point
  9. EDIT: Demo version download here: Hello I've been looking for a way to give "editors" a little bit more freedom regarding the layout, without having to care about CSS, Fields, Templates etc. After playing with PageTable(-Extended) and Bootstrap, this is the (intermediate) result: http://theowp.bplaced.net/upload/prev.html It is just a proof of concept atm. Does anything like this already exist for PW?
    1 point
  10. try this one: $page->social_activity->sort("-created")->slice(0,10);
    1 point
  11. Lenz: If you just output that $config var in your <head>...</head> it will take care of it for you. i.e. <?=$config->pagerHeadTags?> It is just a shorter version of doing this (which you can do in any PW 3.x version): <?php if($config->urls->next) echo "<link rel='next' href='{$config->urls->next}' />"; if($config->urls->prev) echo "<link rel='prev' href='{$config->urls->prev}' />"; ?>
    1 point
  12. Hey @Robin S - I have been experiencing this again too. I though it was solved in some Tracy core updates, but apparently not ? I tend to agree with you that there really isn't a need to move the bar, so I think a fixed option is probably a good idea, so I have added it in the latest version - the option is called: "Fixed Position". You might need a hard reload after changing this to see the effects. This version also includes some more MySQL info in the Diagnostics panel. It's all about the current number of connections etc:
    1 point
  13. There is no connection between the pages table and the fieldgroups and templates tables. You can name your page identically to a template and there shouldn't be any conflict. However, fieldgroups and templates are twins. Creating a template creates a fieldgroup with the same name. Maybe you already had a template called nav, hence the conflict. Alternatively, you may have had a fieldgroup called nav that was not deleted when a similarly named template was deleted?
    1 point
  14. To avoid the notice "Trying to get property 'type' of non-object" and possible issues later it's better to check wether the field is really a Field: $f = $fields->get('myfield'); if ($f instanceof Field && $f->type instanceof FieldtypeLanguageInterface) { // do something }
    1 point
  15. PHP probably runs under the user configured in your anonymous authentication settings. In IIS manager, click on your website, then on "Authentication". Select "Anonymous Authentication" and click "Edit" in actions bar at the right. There you will see the user (default: IUSR). Grant this user modify permissions on the assets folder.
    1 point
  16. Great work @theo! I'm interested to see how this plays out. Will you be sharing the steps/code used to make this? I added your technique to my document "Techniques for flexible page layouts in Processwire" https://docs.google.com/document/d/1peY-FUpevKgy87cKOxIVz8jwcv2-3c61zbiJr3QKO6c/edit?usp=sharing. Will this also handle the case where you have full bleed rows with contained columns on the inside?
    1 point
  17. This module is certainly great, but I wanted something less "technical" for the editor and more wysiwyg and drag&drop. So it is not quite the same, unless I don't understand it completely. Thank you.
    1 point
  18. @theo this module is similar perhaps
    1 point
  19. @horst Can you tell me how/where in the module this hijacks/extends wireMail()? I'm glad that it does, but I am desperate to understand how this works. new WireMail(); // WireMail new wireMail(); // WireMail wireMail(); // WireMailSmtp $mail->new(); // WireMailSmtp This has highlighted one of the many parts of my PW knowledge that is majorly lacking. Edit: Ok. Finally get it. Here's how it works, for anybody else that wonders... wire/core/boot.php loads JUST WireMailTools. WireMailTools::new() looks for any classes that overlay on WireMail. If WireMailSmtp is installed, it will be the class that is returned. If none are found, it defaults to WireMail. Shooooo-wee. Nice to know!
    1 point
  20. Yesterday I released 0.3.1 with the access migrations like described here: It does also include a fix to allow usage in multisite setups using $config->paths->site instead of hardcoding /site/….
    1 point
×
×
  • Create New...