Jump to content

Soma

Moderators
  • Posts

    6,798
  • Joined

  • Last visited

  • Days Won

    158

Everything posted by Soma

  1. I updated the Cheatsheet just today to contain the latest dev.
  2. I think the problem is that you have $email the Inputfield and not the value. You'll need to get the value like $email = $form->get("email")->value;
  3. So I finally pushed the large children branch performance fix and upped version to 1.3.5. Thanks for being patient.
  4. Thanks all for the reports and being patient. I have managed to get back to this and fix issues within Repeater and RepeaterMatrix. Also added ___markupValue() for formatted output ie in Lister.
  5. You can add any field you like for the url in the item tpl. ie: "<a href='{external_url|url}'>{title}</a>" Create a page with an URL field "external_url".
  6. Soma

    opernhaus.ch

    Very flashy Yeah that's a bit of a problem we had with the design concept being delivered to us, but you know how it goes. I think it's trying to solve the different ratio of the images they'd like to use, so it's a feature kind of (one of which I'm not very fond of) Homepage is on the logo. (I know)
  7. Soma

    opernhaus.ch

    No we use https://github.com/bobthecow/mustache.php (installed via composer) in PW, along with some custom Mustache loader and a custom autoloader for our controllers. Controllers are of different types like Template, Components, and Elements all extending WireData. So a mustache view can have its own controller class to handle the data but doesn't have to. The PW page template extends our Template controller class and is used to generate the contents of a page. We use some special mustache file for content items that acts like a switch for all the different component to know which partial to include, so we can simply say that this content item gonna use this or that mustache component. It's simply stacking components one after another. At the end, the whole strategy on this setup was that it works pretty much the same on the patternlab side (data as json) and on the PHP side (data as objects, methods, properties and arrrays), or even JS side (json). The patternlab prototype is found here https://opernhaus.ch/prototype/public/ (currently seems a little broken) but it's not at all the typical style guide or in the strict fashion of atomic design, it's used as a prototyping system to create the content items components and dummy pages in a well-defined structure. We build the different page types right in patternlab as much as needed. Each component can have it's own CSS and JS. (Additionally we also use terrificjs as a helper to make modular JS components).
  8. Soma

    opernhaus.ch

    We relaunched the website for the famous Opernhaus Zürich https://www.opernhaus.ch with ProcessWire. Lots of stuff going on on the front-end. The "design" was made by an inhouse designer that also does their print work and previous website designs. We used patternlab node with mustache template engine as the design/prototype system. Building elements and component as kind of modules (mustache, css, js) which then are 1:1 imported into PW, which then can be rendered using mustache (php version) via a custom "controller" system.
  9. If you're on a mac, - CMD+Shift+3 will screenshot screen and save it on the desktop - CMD+Shift+4 will let you select area and save it on desktop (while dragging use Alt and Shift for additonal control of area selection) + additionally hold "Ctrl" to have it in clipboard to paste somewhere. (you can even paste it directly into this forum editor)
  10. This is what Repeater Matrix does. https://processwire.com/api/modules/profields/repeater-matrix/
  11. @codelearner I'm not sure if PW is superior to Django. But some of the strong point of PW is ... that we have that PW2.1 installation running since 6 years without any updates. We don't have to, since there's no security update needed or anything else. But updating it to PW3.x is a matter of 5 minutes, and it still works without doing anything. Except switching the RTE editor, not because it's an issue but CKeditor is now the default RTE. From the PW side mostly there's like 0h maintenance over the years. Developing and supporting projects with PW can be a fun task. ... there's a hierarchical structure that naturally represents a website structure that can be squeezed and squashed and moved around without much efforts, build self containing structures and wrap it up with some code. ... build modules in no time for whatever task. It's consistent with using the API you already familiar with. PW admin itself is built using its API. It's easy to manipulate and extend. ... occasionally you'll hear a "I just love PW" from yourself or your coworker. Usually when the deadline is tight and you have make last minute changes that would be impossible in other Systems. How do you come to this conclusion? Have you already developed something 3 months in PW and then built it in Django?
  12. I'm not sure what was the point exactly. It works, but I need the id the moment I created the page table page not after saving it.
  13. What do you mean? It's not the "selector" option it's the "selector_field" option, where you can define selectors dynamicly, and it's not a workaround but especially for cases like this.
  14. I'm not sure this needs a hook or even possible with one. You could use the 'selector_field' => 'nav_selector', // string (default 'nav_selector') define custom PW selector by using a property or field on a page. Use this setting if you want to overwrite the default nav_selector to use a field or a property (can be runtime) to define the selector. See docs: https://github.com/somatonic/MarkupSimpleNavigation#added-support-for-nav_selector-propertyfield-and-selector_leveln-new-in-121
  15. No theres nothing short except the xtemplates option.
  16. Hook to MarkupSimpleNavigation::getTagString to alter the item: Little more in the docs on the hook to alter the output of an item: https://github.com/somatonic/MarkupSimpleNavigation#hook-for-custom-item-string-new-in-120 If your top level pages use their own template you could easily use "xtemplates" options to render the items differently using the template you specify there.
  17. There's nothing special about it. Just as you normally would style a navigation. The module doesn't do that for you, it just outputs a nice clean nested UL, just a few classes for parents and active. https://www.smartmenus.org/docs/ Is a simple JS Script to generate dropdowns and also resposive. You can drop the smartmenu plugin with their CSS and mobile hamburger button as in the docs (further down) and add the id and class to the outer tpl <ul id="main-nav" class="..."> of MarkupSimpleNavigation and it works out of the box,
  18. There's a story from Richard WIlliams (Animators Survival Kit), asking Milt Kahl (greatest Animator who ever lived) if he also listens to classical music during work. Milt responded, that this is the most stupid question ever, and that he's too stupid to do more than one thing at a time. Richard became a better animator instantly not listening to music anymore. He educated many animators working on computer, very addicted to music, to stop it and they all improved in their work a lot. Since I stopped listening to music (which is hard at first) while programming or painting I noticed a lot of improvement in my work.
  19. Nothing different from PW2 to 3 really. This code is even in the default install themes and working normally.
  20. Thanks. I guess that's why the modules states it's compatible until PW 2.4. I have no plans to update the module for 3.+.
  21. Also as a side note. Not sure what the $this->redirectPage is but you don't need to pages->get() it when you compare the id anyway. Also if you have already an autoload module with ready() you could do it directly in there instead of a hook. $this->wire("page") being the page requested about to get rendered. public function ready() { $redirectPage = $this->wire("pages")->get(1001); if($this->wire("page") === $redirectPage) return; $this->wire("session")->redirect($redirectPage->url, false); }
  22. How about redirect to the url page->url not the page object which would be the id. Also i would use $this->wire ('pages')->... not $event->pages...
  23. Every request will create an entry, even ajax request in the background. So if you look at the log, it will poll it all couple seconds creating a new entry. Otherwise it's called once for every request, unless you have multiple instances. You shouldn't do something in the init other than setting properties, hooks or something. No resource heavy stuff if not needed.
  24. Soma

    Aligator

    Hey, thanks for the input. I was putting my head into it quite a few time yesterday, and messed up something. Took a while to figure it all out today. It can get complicated. You refactor stuff, then suddenly it all messed up. I commited a new version with some of your input and various fixes. https://github.com/somatonic/Aligator/commit/dc4d8aa19ff665e24aa07ccba65fd3aff0d4e002 The static level I also recognized that it gives problem when using more than one menu. Also the default options now carry over all levels. I don't think a "all" array is needed just for that, since it was the intention to have a default that is the fallback. I added a $states variable to callback (third argument) that returns a string with classes for the different states. You can enable it and configure it too. Something like this was my testing scenario: /** * load Alitgaor module * -------------------------------------------------------------------------------- */ $nav = $modules->Aligator; /** * first menu * using PageArray for first level and prepend root page * -------------------------------------------------------------------------------- */ $menuPages = new PageArray(); $home = $pages->get("/"); $menuPages->add($home->children("template=basic-page")); $menuPages->prepend($home); $nav->enableStates = true; // enable states ("parent current has_children first last") $nav->levels = 3; // set max levels to render // the default options for all levels $nav->setDefaultOptions(array( "selector" => "template=basic-page", "callback" => function($item, $level, $states){ // $states is a string of item state classes to insert somewhere $classes = $states ? " class='$states'" : ""; return array( "item" => "<a href='$item->url'>$item->title</a>", "listOpen" => "<li$classes>", "listClose" => "</li>", "wrapperOpen" => "<ul class='dropdown'>", "wrapperClose" => "</ul>", ); } ) ); // render the menu $content .= $nav->render($menuPages, array( array( // level1 "selector" => "template=basic-page", ), array( // level2 "selector" => "template=basic-page|article" ) )); /** * render different menu with default options and using a root page * -------------------------------------------------------------------------------- */ $nav->levels = 4; $nav->collapsed = true; $nav->setDefaultStates(array("is_current" => "active")); $nav->setDefaultOptions(array( "selector" => "template=basic-page", "callback" => function($item, $level, $states){ return array( "item" => "<a href='$item->url'>$item->title</a>", "listOpen" => "<li class='$states'>", "listClose" => "</li>", "wrapperOpen" => "<ol>", "wrapperClose" => "</ol>" ); } ) ); $content .= $nav->render($pages->get("/")); I'm not sure, there's possibly still something that isn't covered or I missed but seems working fine here. Thanks
×
×
  • Create New...