Jump to content

Soma

Moderators
  • Posts

    6,798
  • Joined

  • Last visited

  • Days Won

    158

Everything posted by Soma

  1. Without knowing what you did its not possible to say much without seeing the module. Can you post the modules in question?
  2. I'm still not sure how all that is different from what Pagetable already does. I create block templates with the fields I need then add it to a pagetable field and use the template files to output the blocks. They can be sorted and published etc. It's easy to setup and use. Pagetable extended by mademyday can be used to see the output directly in the pagetable. I can be used for different things not just blocks. What else is there needed?
  3. I think there was or still is sometimes an issue with manual sorting, but can be sorted out with $pages->find("parent=/themen/, sort=sort");
  4. This is a issue since long time. It's that page parent doesn't get updated. I ran into it with moving page with children... but I think clone has the same issue... Snot sure it's same issue. But try moving page with children to other parent and back.
  5. RT @processwire: Introducing ProcessWire ListerPro – A powerful new way to browse and manage your pages – https://t.co/BxfHF9Qbj2

  6. I thought about it million times so plus one. But then this functionality is in Asm select just not active. I would love to see Lister type search for adding pages to page field. But pro lister is commercial .. too bad.
  7. I have lots troubles writing on my new mobile. It's horrible.
  8. You could also say because of this particular template setup pw lost many advanced devs before even looking further. +1 what joss said. That's where I see PW struggles a lot. Living in between advanced and casual is always a bad idea/decision.
  9. First get the the pages you want to delete and then delete them.. not searching a reference with a page you already deleted.
  10. But second find won't return result.. ? Doesn't matter if page object is still in memory. Can't see anything else cause it's no problem to delete pages.
  11. You delete the first so second reference in find does NOT work cause its not there anymore...
  12. How is this different than https://processwire.com/talk/topic/7044-release-flagpages/ ?
  13. I think you do maybe not really understand and my fault to mention "template engine". There's not template engine other than what PW has. I don't have a "template engine" on top of already existing template engine. I'm just using <div><?php echo $variable ?></div> and some simple logic if and foreach's, no template engine at all. Anyway It's all there and you don't have to built something, just structure differently.
  14. Yeah there's pros an cons. But it seems you never had done bigger complex sites where there's a lot of demand for modularity and flexibility. I simply wouldn't be able to do what I do currently (project) with that old default approach. And I used many different approaches on PW projects. That's why one have to come up with other approaches. You can for sure, but sorry, if that's your main concern, I have to tell that's just not true. It's not required at all. It's just an (bad?) example by Ryan. You don't have to do that and there's a lot of ways you can avoid that. I use delayed output with using templates only as a controller that defines a layout template, load, or delegates and renders widgets/partials/content using view templates etc, where there's mainly the plain html tags with some php used as "template engine", it's only basic presentational logic. Maybe also have a look at the Spex template helper module.
  15. @everfreecreative The thing is if you have like a lot of templates you'll have to do this for every template, once you want to change something on that part you'll have to edit all templates, so it doesn't scale well and isn't as flexible. If you wanted to conditionally not include header and footer, you'll have to edit all templates again. Once you want to be able to be more flexible with different layout types you're left with editing all templates to implement some logic. Once you decide you need to have different main container template for certain templates ... it doesn't scale as well. Of course to some extend you can incorporate things before the header include, but what if you have some after you wanted to add a css or js or something else? Maybe you want to be able to render a widget (page) inside content generation, that has a module or partial, that then wants to load conditional things like assets, you can't with your approach as the header is already "rendered".
  16. Ah nice! I think I kinda ignored or forgot the little appended note there in the timers tab. This is relatively new. I wasn't aware of the context when writing thinking about templates!
  17. Or just use $log ? $timer = Debug::timer(); ... $log->save("mylog", "phase 1: " . Debug::timer($timer)); $timer = Debug::timer(); ... $log->save("mylog", "phase 2: " . Debug::timer($timer)); Will create a log in site/assets/logs/ as mylog.txt
  18. After all I think it depends a lot on what context and how it's used. If in templates, a call to the main module (which is not autoload), you can't use the autoload condition, unless you also trigger something from the template which is not that nice. In the end I think a conditional autoload also requires some "resources" so loading a simple module that only has hooks anyway, might not be as bad you think. As far as I know modules that hook into something need to be "autoload" anyway, if using a condition or not doesn't really matter and is a ok tradeoff? Not sure if I'm overlooking something obvious. Of course it's a good thinking in the first place to not waste resources, would be good to maybe have some sort of data to show what impact autoload really has when there's 100's of additonal modules? I'm also curious how Ryan would see this, I can't remember there was ever something in more depth about this. Anybody care to test?
  19. I'm not sure I really understand it enough, is it just to format values? But isn't that what TextFormatter modules are in PW. There can be multiple and sorted, attached to a per field basis. If there's any it will run the value through the Textformatters. Fieldtype::formatValue is used to sent through a value of a field after wakeup, but only when outputformatting is on ($page->of(true), you can also disable it or get the unformatted value). Some fields use that to format a value like Datetime or Page. It can also be hooked via modules or in templates. To get a unformatted value you can use $page->getUnformatted("fieldname"); A hook in a module example $this->addHookAfter("Fieldtype::formatValue", $this, function(HookEvent $event){ $value = $event->return; $value = $event->arguments("value"); $page = $event->arguments("page"); $field = $event->arguments("field"); $event->return = "new value"; }); About your module, I still don't understand the real world use case for this or and if it's really best way to go for it. Anyway I think it's a little problematic (?) to have the helper functions outside the module in the global namespace (no namespace yet in PW) and if it's good to name a module just "Filter" ? Edit: I'm maybe also confused by the word "filter" in context to PW, cause there's a $wirearray->filter(selector); but it's not about the same thing?
  20. Sorry wasn't reading carefully. Maybe if you can provide more what you want to archive, maybe there's better alternative ways. It's also good to know that if you change the autoload setting in code you have to refresh module cache or reinstall module.
  21. Maybe worth reading https://processwire.com/talk/topic/5477-check-if-a-module-is-loaded/
  22. You have to set the default page name cause it's required.
  23. If you go the urlSegment REST like routing you could still ensure and set the maxUrlSegment for your module. This for example would work out: <?php class MyHelper extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'MyHelper', 'version' => 1, 'summary' => '', 'singular' => true, 'autoload' => "Process=ProcessHello", // only load on your module ProcessHello ); } public function init() { $this->config->maxUrlSegments = 7; // more ? } } It's not possible from an non autoload Process module to overwrite it but a little helper module would do fine.
×
×
  • Create New...