Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/14/2021 in all areas

  1. @Macrura, Thanks again for your detailed and to-the-point report on what happened at Dreamhost. I was able to get Dreamhost to adjust the ModSec ruleset and things are working again.
    2 points
  2. @cstevensjr, this started on Wednesday of this week when Dreamhost made some bizarre unilateral ModSecurity setting that broke every ProcessWire site's ability to upload images or files. You have to open a support ticket and tell them to change the ModSec setting for every domain on your account to allow the CMS to work. They should be able to check their logs and know what to change, but you also might have to go back and forth with them and test it. I exchanged probably 10 emails with them on Wednesday while they repeatedly tweaked the ruleset until i was able to upload again. Last night i had to send them a list of ~20 sites that they had to adjust the ruleset for and they replied today that it is now done, but only time will tell if I start to receive complaints from site owners that they can't upload. This is certainly disappointing behavior from Dreamhost, and they should make amends. Hopefully they are going to learn a hard lesson once they get an avalanche of support complaints about this. By the way, you can easily tell what the problem is, if you upload while viewing the network panel. You'll see probably a 418 error and when you view the response you'll see Internal Server Error. 418 is the DH response for anything related to ModSec. In addition you can go into the server logs and open the log file (which may be pretty huge by now) and see the mod sec errors.
    2 points
  3. https://www.tandc.games/ New website for my games design company. We're currently working on Grace Hopper: Bug Rescue about computer science history, check it out and let me know if you have any suggestions for historic characters or topics/hardware. Built with PW, and is heavy built upon my other website https://www.ethicalby.design/ basically taking it as a base and building on it.
    1 point
  4. Hi everyone, I'm not an expert, but I regularly make small to medium-sized pages either in static html or for wordpress (_s). I now use Processwire instead of creating static pages, because I can then maintain the pages more easily and I am also faster. I created a site profile with, which is the basis for my work. Since I like to work with sass, I use the sassify module and have created a small boiler for it. html-bones is my html base. And for this I have built in the osano cookie consent. Maybe someone can still use something of it, or there are suggestions for improvement. In fact, i am certainly not using every possibilities of processwire in the best effectivly way, but this basis is sufficient for the type of internet pages that i usually create. I usually don't accept more complex jobs at all, so as not to overwhelm myself. You can find the link to this profile here: https://github.com/eversthomas/processwire/tree/master/site-html5blank-sass And an example: https://processwire.end-linkage.de/ Greetz from germany Tom.
    1 point
  5. Are you sure you need to check? If you place a custom "loaded" method in your custom page class only pages using your custom page class will execute that code anyway... Or am I missing anything? But if I'm missing anything checking for the current pageclass is as easy as this: if($page instanceof self) { ... }
    1 point
  6. Thx RobinS for the idea about the getExtraMarkup hook! I slightly changed your version: $this->addHookBefore('AdminTheme::getExtraMarkup', function (HookEvent $event) { $config = $this->wire->config; $url = $config->urls($this); $config->scripts->add($url."lib/moment.min.js"); $config->scripts->add($url."tabulator/js/tabulator.min.js"); $config->scripts->add($url."Grid.js"); $config->scripts->add($url."RockGrid2.js"); $config->styles->add($url."tabulator/css/tabulator.min.css"); }); using the "before" hook makes it possible to use the config->scripts|styles->add syntax ? I'd love to get a $config->scripts->addAfter("/my/script.js", "/my/other/script.js") feature - but acutually I've always found a way to get the correct order by using proper hooks...
    1 point
  7. Had this same issue today, ie get the customised label for a page/template field and tried all the above. They all returned the original field label and couldn't find any reference to the 'true' option when getting 'fields' or 'field' in the API Docs. Maybe PW has moved on or more likely, I missed something. Anyway, what did work for me was: $page->getField("body")->label; https://processwire.com/api/ref/page/get-field/
    1 point
  8. Thanks for all your suggestions. Here is what I use right now in my ready.php $wire->addHookAfter('AdminTheme::getExtraMarkup', function (HookEvent $event) { $parts = $event->return; $parts['head'] .= '<link rel="stylesheet" href="' . $this->config->urls->templates . 'admin/admin.css">'; $parts['head'] .= '<script src="' . $this->config->urls->templates . 'admin/admin.js"></script>'; $event->return = $parts; }); I don't want to rely on another module like AoS or AdminCustomFiles, because I think adding another module just to add styles and JavaScript is overkill and bloat. Instead I want to add the assets in my own modules, or in ready.php. I still think that it would be good in the core, and the core could still be lean. There are already methods there to prepend or append assets, but they don't work correctly because of the init order. Mainly the problem is that core modules should be loaded first with their assets like jQuery and CSS, etc, and then I should be able to add my assets after them to override them. I know it might be a specific case, where you want to alter default behavior and styles of the admin, but it is something I often need. In most cases the actual behaviour $config->styles->add($config->urls->templates . "admin/admin.css"); is just fine, if you are not trying to override some styles
    1 point
  9. See here: https://processwire.com/talk/topic/12033-get-overriden-field-label/
    1 point
  10. That's one solution, the other would have been to determine the field type through the page's template. $tpl = wire('templates')->get($templatename); if( $tpl->fields->get($fieldname)->type instanceof FieldtypeFile ) { /* true for file and image field types, import as file */ }
    1 point
×
×
  • Create New...