Leaderboard
Popular Content
Showing content with the highest reputation on 09/10/2020 in all areas
-
You can't use the PW core image plugin because in FormBuilder there is no page to store images in. But I have just released v0.1.2 which lets you configure a global toolbar for all Markup CKEditor fields. If you add "Image" to the toolbar setting you can use the standard CKEditor image plugin to insert an image by URL.2 points
-
1 point
-
The easiest way to make sure you always populate the default language, is a one-liner before all your regular page-creation functions: $languages->setLanguage("default"); and of course, if you always explicitly want to edit the french value: $languages->setLanguage("fr");1 point
-
I think here are some different possibilities: You create a template + page You use the same template/page where your form is (And check it with the $input API) Create a template / page for different functions (for multiple pages) - Here you have to use the $input API to decide what to do Depending on how complex everything is, you have to decide how you want to use it ?1 point
-
https://processwire.com/docs/start/variables/input/ https://processwire.com/blog/posts/pw-3.0.125/ https://processwire.com/api/ref/wire-input/ $wire->addHookAfter('InputfieldPage::getSelectablePages', function($event) { if($event->object->name == 'myselect') { $temp = $this->wire('input')->get('temp', 'text', 'fallback-template'); $event->return = $event->pages->find('template=$temp'); } });1 point
-
Using / as dividers signifies an American date format of MM/DD/YYYY, which makes only the latter invalid.1 point
-
@MSP01 1.. pw cachis any.thing it load, so no.many how times u.cal $page->feld or $page->parent->smoga or $page->feld->bilpa --- it load feld or smoga or bilpa 1 time....... if autojoinin for.feld smoga or bilpa then it load it with th 1 queery that loader page 2) yes 1 sql to loader template=settings page and 1 sql to loader somesetting. ifs somesetting.feld is autojoinin then 1 sql for both. if u.cal eithers template=settings page agains or somesetting agains then alredy loadeded so no xtra sql unless u $pages->uncacheAll() whch clearys it all 3- may be. autojoinin can makes littel small faster but at cost of memry .use autojoinin only for.felds that u accessor on.evry load of $page. title good one to be.autojoinin ......most othrs not;;; body or images and most betters not autojoinin1 point
-
@maddmac Thanks for the suggestion! As far as I can tell from the documentation on creating cards, custom fields can't be send in the same POST request the card is created with. But you can utilize a hook to add custom fields whenever a card is created / updated (see the hook documentation for the module). Something like this: wire()->addHookAfter('TrelloWire::createCardForPage', function (HookEvent $e) { $TrelloWire = $e->object; $page = $e->arguments(1); $TrelloWireCard = $TrelloWire->buildCardData($page); $api = $TrelloWire->api(); $cardId = $TrelloWireCard->id; $customFieldId = 'id-of-the-custom-field'; // replace with actual custom field id $api->put( sprintf('cards/%1$s/customField/%2$s/item', $cardId, $customFieldId), ['custom-field-data' => $page->my_custom_field] ); }); Quick and untested, might need some adjustments. I haven't worked with custom fields yet, so I'm not sure what data a custom fields needs (the documentation is also handwavy about it), but this should be a good starting point. A the moment this will only work correctly with the dev version of the module (branch JSON-request-body on Github) and with a core that includes the pull request mentioned above.1 point
-
For whatever reason, the power was out for our neighborhood for one day this week. As a result, I’m running a day behind schedule here and haven’t yet finished some of the updates I’ve started in the core, so no core updates to report just yet. Instead, I’ve been focused on finishing up the newest FormBuilder version, which has taken nearly the whole week to finish, but I did manage to get the new version out today (available in the FormBuilder board), and I’m really happy with what it adds. Here’s what's new in version 44 of FormBuilder: This version makes significant improvements to FormBuilder's entries listing features and API. You can now find submitted form entries with selector strings just like you can with pages in ProcessWire. It’s like using $pages->find() except for form entries. You can perform queries on any field in the form and use several different operators. This also includes some of the new text matching operators new to the most recent PW master version. The entries screen for any form now gives you option to search and/or filter based on any field in the form. You can also create multiple filters on top of one another, matching multiple fields or even multiple values for the same field. You can dynamically select what columns appear in the entries list, and in what order. This is very much like the “Columns” tab in Lister or ListerPro. You can also search, filter, display and export field values from nested forms, which was not supported in earlier versions of FormBuilder. You can stack multiple search filters on top of one another for AND conditions. When it comes to keyword searches, in addition to searching individual fields in an entry, you can also search all fields in the entry at once (something you can't easily do with pages). You can now sort by any form field in the entries list by clicking the column headings. Also supports reverse order. In earlier versions of FormBuilder, you could only sort by ID or created date. The CSV export has been improved with options to export based on your filters/columns selection, or export all rows/columns. In addition there are now options for letting you specify what type of column headings to use and whether or not to include a UTF-8 byte order mark (which some MS Office apps apparently prefer). In addition to all of the above, there have been numerous other minor optimizations, bug fixes and other improvements throughout FormBuilder. A few new hooks have also been added in FormBuilderProcessor. Note that versions 41, 42, and 43 were all minor-update versions that were only released casually in the FormBuilder board for specific cases. Version 44 of course also includes the updates from those 3 versions as well. FormBuilder v44 requires ProcessWire 3.0.164 or newer. To support the new search/filter/sort functions in the entries list, you must have MySQL 5.7 or newer. For earlier versions of MySQL, these features are disabled except for the “search all fields” option. Next week: back to core updates, and hopefully the newest ProCache version will be ready as well. Thanks for reading and have a great weekend!1 point
-
Will second https://www.11ty.dev/ as an awesome static site generator, really great product. For a list of lots of options check https://www.staticgen.com/ Gatsby isn’t really a pure static site generator, it’s more a framework for creating progressive single page app websites with react. It has a heavy reliance on graphql and can handle server side rendering like next / nuxt / sapper. It would actually be pretty overkill to use gatsby just for a completely static site (ie one that doesn’t use a database of any kind). The power of these frameworks is data is pulled in from one or more sources at build time which is used to programatically create pages / populate content. This data can come from the file system, from a csv file, but mostly it is stored in a cms. There are lots of “headless cms” out there (I like to think of these as more cms as a service) that you will read about being used with gatsby. The most promising of these in my opinion is https://www.sanity.io/ which is a pretty amazing product. However there is nothing stopping you from using PW for this. 11ty makes it super easy to grab data from anywhere to use at build time (unlike gatsby where it all has to be ported into its own graphql instance), and if you wanted you could have all your content stored in PW, create some json api endpoints manually or using a module like the graphql one, and use that data to build a flat HTML static site with 11ty that you host on netlify or zeit. Obviously this requires rebuilds when content changes, and doesn’t allow much interactivity, which is where the more complex feature set of gatsby comes in... server side rendering etc. Another project I am really digging at the moment which I think more meets the topic of this post is https://saber.land/ If you are into vue definitely check it out.1 point
-
Although doable, I'd only recommend a system like this to be implemented using ProcessWire if the rest of the project must (or already is) be highly coupled with PW and it doesn't make sense to decouple it for whatever reason. Otherwise I'd recommend you to implement it using another framework. PW shines in the content management part, and I love it, but it may present you with some limitations in its developer-experience department when you need to implement some business logic that relies heavily on integration of payment systems, user data input, generation of reports and especially tests. There's also a myriad of similar systems like this already implemented that you can use as a base, like this one https://github.com/LaravelDaily/Laravel-Test-Result-PDF (demo: https://www.youtube.com/watch?v=GmLFHGud7I8).1 point
-
I found the issue and created a pull request with a fix. Problem: If SeoMaestro is mapped to a page fieldset or page repeater (e.g. $page->meta->seo), the fieldset will be handle as first page for the breadcrumb aka structured data and got listed as item. Solution: I added a check to prevent the listing of pages based on PageRepeater. Link to the pull request: https://github.com/wanze/SeoMaestro/pull/251 point
-
Static site generators will probably be 'the next big thing'. You get way better performance and security by default than you could have with any CMS by definition. Which doesn't mean that you can't have dynamic content like comments, e-commerce etc. But instead of bundling that functionality, you're using external services, APIs, serverless functions and build automation to persist data and trigger builds whenever something changes. I'd recommend reading the Jamstack book (created by the Netlify people), you can get the ebook for free and it explains all the concepts related to SSG. By the way, you don't need NodeJS / NPM to have a static site generator. Though many SSG are built with JavaScript, they use NodeJS only as a runtime for the build step, not as an actual server. But there are SSG written in all kinds of languages - check out this site if you want to find one you like. One could argue, by the way, that the ProCache module for ProcessWire is also kind of a SSG generator, even though it works a bit differently than most tools on that list. My current recommendation is eleventy, I'm currently rebuilding a couple of my own sites as well as a ProcessWire-related project that I might release soon with it ?1 point
-
I really like to use Insomnia testing api-calls. It's a stand-alone tool for Mac, Windows and Linux. And the free plan suits perfectly for all my needs - the paid functions are primary focuses on collaboration features for teams.1 point
-
Here now some details how we use ElasticsearchFeeder on www.blue-tomato.com: Our main webshop technology is Java / SAP Hybris which is mostly developed by an external developer team. Hybris is good for multichannel webshops but not the best tool for general content management or for creating quick new content. So we use ProcessWire for our editoral content like blogs, landing pages, buyers guides etc. since 2 years. We created a RestAPI where SAP Hybris gets the content from ProcessWire. So ProcessWire prerenders the main-body and gives it with some metadata to Hybris which puts them between the webshop header and footer. This works great with following page sections: https://www.blue-tomato.com/blue-world/ https://www.blue-tomato.com/team/ https://www.blue-tomato.com/buyers-guides/skateboard/skateboard-decks/ Since this are kind of static pages it worked very well but we want to integrate also our content dynamicly on other high traffic pages like the homepage or product detail pages. This is why we decided to put our content into ElasticSearch. In front of ElasticSearch we created an GraphQL / Node.js Server, because we mashup our ProcessWire data with product data from other (REST) sources. For the first step we created two kind of widgets, which run on the Blue Tomato Homepage: Blue World News (latest news from our blog) Shop The Look The Shop The Look Widget is our first try to mix and show data from different sources. The Editor of a "Look" has to create the look in the ProcessWire Admin panel. He uploads the look photo and has to put product IDs into a Table. No product price, title or image. All of the product data will be fetched by GraphQL from our other database during the request. All widgets are rendered with React. I hope I could give you a short overview of what we do with ProcessWire and ElasticsearchFeeder.1 point
-
For anyone stumbling over this topic, here's the solution (don't forget this is not production code - sanitize your data!). Make sure you are adding the Querystring (Qs) lib somehow axios.post('./', Qs.stringify({ yes_no: this.yes_no }), { headers: { 'X-Requested-With': 'XMLHttpRequest', 'Content-type': 'application/x-www-form-urlencoded' } }) .then(function (response) { console.log("response:", response.data); }) .catch(function (error) { console.log("error:", error); });1 point
-
Hi Fred, here's some code that might be helpful. Also, make sure page numbers are enabled on the page's template (URLs tab in Setup > Templates > any-template). $limit = 10; $items = $pages->find("template=something, sort=name, limit=$limit"); $total = $items->getTotal(); if($total) { // there are results present $numPaginations = ceil($total / $limit); $pageNum = $input->pageNum(); if($pageNum == $numPaginations) { // you are on the last page of results } else if($pageNum == 1) { // you are on the first page of results } else if($pageNum > $numPaginations) { // beyond the last page, do a redirect or a 404 } else { // somewhere in the middle of the paginations } } else { // there were no results on any pagination } Also see the PaginatedArray type (PageArray is a PaginatedArray): http://processwire.com/api/ref/paginated-array/1 point
-
you mean counting like this? $kids = $pages->find("template=poi, has_parent=$page"); $interests = new PageArray(); foreach ($kids as $k) $interests->import($k->interests); $iTotal = count($interests); foreach ($interests as $i) $i->useCount = count($pages->find("interests=$i")); echo "<h3>Interests ($iTotal)</h3>"; echo '<ul>'; foreach ($interests->sort("-useCount") as $i) { echo "<li><a href='interest/$i->name'>$i->title</a> ($i->useCount)</li>"; } echo '</ul>';1 point