Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/25/2023 in all areas

  1. Sometimes, you want to search a text field by the length of its content. FieldtypeText doesn't provide this functionality (yet). It's possible to add the necessary SQL to a query by hooking into PageFinder::getQuery like @bernhard pointed out here, but that's of course not really straight forward. There's also an open feature request for FieldtypeText in processwire-requests. FieldtypeTextWithLength is an extension of FieldtypeText, so you can switch your field's type between the two without loosing any information. After switching your field to "Text with .length Selector", you can search by the (character, not bytes!) length of the content: $pagesWithShortHeadlines = $pages->find('headline.length<10'); You will also find a new "Length" subfield when using Pages -> Find in the PW backend:
    3 points
  2. This week in the blog we'll take a detailed look at the newest addition to the ProFields set of modules: the Date Range Fieldtype and Inputfield. This post serves both as an introduction to, and documentation for this new module. In addition, the v1 (beta) release of the module is now available for download in the ProFields board. https://processwire.com/blog/posts/date-range-fields/
    2 points
  3. V interesting article! Thanks all. I have also implemented latte as the main templating engine in a site. I didn't use any of the big module solutions because I think my needs are simple and fewer dependencies leads to easier long term maintenance. I have implemented latte as an api var and used page classes for all the page type specific work. It's been good as I've leveraged inheritance in both page classes (I'm also using pageTableNext) and also latte (`{layout...}`), reducing duplicate code. One observation I had was that I like to use latte to make html templates more **readable**, and do all the heavy lifting **logic** in pure php in page classes. (I've also observed that I'm that committed to markdown that I use it instead of fiddly, non-semantic buttons I'd have to scroll back to get to! Oops)
    1 point
  4. That’s brilliant @ryan. I wish I’d had that a few years back when I was developing my holiday cottage booking system. Could have done the booking form for it in a jiffy! Shame it is only days though, not times, as I can’t use it for events in an app I am currently redeveloping.
    1 point
  5. Hello @joe_g, I see there is a "unique" property in page settings ("Settings" tab > Status), that ensures no other page will use the same name. If you create the page with API, I think this should work: $page->addStatus(Page::statusUnique);
    1 point
  6. Hi all, This is our new website, still based on Processwire since 2015, we are very happy to be able to work with such a good piece of software. Thanks everyone for the support. https://velvetyne.fr You can read more about this new version here https://velvetyne.fr/news/new-website-v3/
    1 point
×
×
  • Create New...