-
Posts
741 -
Joined
-
Last visited
-
Days Won
12
Posts posted by psy
-
-
@franciccio-ITALIANO welcome to the forum and ProcessWire. ProcessWire is not a 'cookie-cutter-fill-in-the-blanks' website builder. Quite the opposite. Any and every field, whether generated by the profile you chose in install, or afterwards can do or be whatever you want. It's a mind shift... That's the beauty of ProcessWire. YOU are in control
-
Untested but may something like:
<?php $tags = $page->tags->implode(','); ?> <meta name='keywords' content=<?=$tags>' ?>
-
1
-
-
@Chris B there are a couple of ways.
1. The most secure... use a hook to add the value to the FB after submit (or whatever hook works for you best). See https://processwire.com/store/form-builder/hooks/
2. In your template, use the options array to populate the page id into a hidden field that's rendered but not displayed, eg:
$forms->embed ('my-form', array('postulate_job' => $page->id));
-
1
-
1
-
-
@cjx2240 yep. LoginRegister & ProcessForgotPassword modules could do with some serious re-work. Especially awkward when the user registers in a browser that's not their default or on a different device
-
2
-
-
6 hours ago, Atlasfreeman said:
$children = $page->get('template=onecolmn|twocolumn, sort=sort');
You may want to revise this line. 'get' will return only the first match. To return a page array, you need $pages as well. Try:
<?php $children = $pages->find('template=onecolumn|twocolumn, sort=sort');
-
3
-
-
@wbmnfktr thanks for the tips ?
Version so old, cache had only one folder LOL
Tested in a staging environment.
Upgrade of PW core - almost 150 versions from 2.3.0 to 3.0.141 - worked first time. Gotta love it!
Couple of modules needed upgrading and most went smoothly.
Solved issues with ProcessCustomAdminPages. Couldn't upgrade so recreated the admin pages and assigned the necessary templates
Now resolving a few hiccoughs with custom template code and confident I'll get through
-
5
-
-
@bernhard would definitely do that if I had the option. The AWOL developer did a fabulous job and the code is beautifully written. I need to do the upgrade first to prove myself to the client.
The rebuilt site will use the old data and redesigned to take advantage of the power of today's PW - hopefully mainly template work with a few new modules.
Client has used WP in the past and couldn't believe the PW2.3.0 site still worked and hadn't needed one security update in all that time
-
2
-
-
6 minutes ago, wbmnfktr said:
I maintain a 2.5 instance of ProcessWire which needs to be upgraded in the future, too. Not only ProcessWire itself but design and functionality as well.
This 2.3.0 site once upgraded will need a redo of design & functionality too. That's Stage 2. Need to get Stage 1 done first
-
Noticed a couple of posts in the forums today regarding upgrading from 2.x to 3.x just when I won a new client who has a PW 2.3.0 site that needs upgrading. Yes, you read that right 2.3.0, 5+yo and still going strong without a single security update.
Confident it can be done and welcome any tips/tricks/hints/tutorials to avoid pitfalls
-
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/
-
4
-
-
@a-ok try adding $p->of(false); before adding the image. You've included output formatting off above when creating the page, but then the page is saved which automatically turns it on again.
-
1
-
-
Maybe take a look at URL segments? https://processwire.com/docs/front-end/how-to-use-url-segments/
-
3
-
-
@3fingers edit your original post title with [solved] at the start ?
-
1
-
-
@3fingers rather than 'find', 'findMany'. 'find' loads all found pages in memory. Another alternative maybe @bernhard's RockFinder module?
-
Guess I'll have to learn about valueGetter. This is a baptism of ? ?
-
9 minutes ago, bernhard said:
RockTabulator and RockFinder2 will make things a lot easier
Looking forward to it. Have to get this client's job finished and paid first. ?
-
7 minutes ago, bernhard said:
Have you tried double-clicking the cell, then it should filter for the value of the cell automatically. A triple click removes the filter from that column.
Well that worked, thanks! Not very user friendly though. The general public wont get it ?
-
My first attempt at RockFinder & RockGrid and truly impressed. Well done @bernhard!
Have already created my dataset using joins, changing column headings and the tip for Select Options in my custom php file to display the option's title rather than the value in a column. All good.
Problem arises with the filter for the Select Options field, column is project_status, with column header changed to 'Status'. I've no idea how to change the filter from the PW assigned index value to the text value of the field. See examples:
1. Full data set

2. Using a text entry in the filter, eg starting to type 'draft'

3. Entering the PW assigned select options index for 'draft'

I'm guessing it needs a custom filter and would appreciate help and guidance.
TIA
psy
-
@Robin S - brilliant! Your code works like a charm on my site after adjusting a bit of my own code to suit.
Can't thank you enough ?
-
6
-
-
Thanks @Robin S great work however still can't get it happening on my site ?
Using your method I get a Forbidden 403 Error in the Chrome dev console, eg https://mysite.com/uppy 403
-
I've been in htaccess hell for days. Has anyone successfully implemented a TusPHP server with ProcessWire using the Upply client? If so, please share how you did it.
https://github.com/ankitpokhrel/tus-php
I saw that @LostKobrakai had created a chunked upload solution https://gist.github.com/LostKobrakai/ddb11c64dcb0f1bf1c8eed4dd534a868 that used resumable.js which is great but I'd really like to to use the Uppy client, and eventually implement the Uppy companion plugin to upload directly to a cdn such as Amazon S3 or Google Cloud.
I've exhausted every possible .htaccess variation I can think of. Also tried to implement the Tus server in a subdirectory which ended in CORS purgatory.
The Uppy client is beautiful and super simple to implement in a template. Getting the Tus server to work in a ProcessWire installation is a different matter. Even tried to adapt the WordPress plugin suggestions but guessing the WP htacess isn't nearly as comprehensive as the ProcessWire (with ProCache) htaccess file.
This is the bit that breaks ProcessWire:
# .htaccess RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^files/?(.*)?$ /server.php?$1 [QSA,L]ProcessWire has its own very important 'files' directory so I changed the Uppy/Tus directory to 'tus-endpoint' and tried to replace server.php with a PW page called 'tus-server' that did the TusPHP server.php stuff in a template.
Help and suggestions extremely welcome
-
Just throwing it out there and not the answer to all PW static site situations, but a PWA like https://www.pwabuilder.com/ may help.
In my experience, there can be glitches between PWABuilder depending on the config chosen, and ProCache with too much unsynched caching. Definitely not the answer if your site has lots of forms and/or dynamic content, but for static sites that have dodgy internet connections it's definitely worth investigating.
-
4
-
-
From @ryan's comment in the blog post https://processwire.com/blog/posts/webp-images-in-pw/:
"By the way, if for some reason the webp results in a larger image (which is very rare), calling the $image->webp->url will return the smaller (non-webp) image."
Very excited to see webp support in PW core then followed all the instructions. Couldn't get it working, or so I thought. Seems I did.
OK, I take the craftsman's approach when adding images:
- Photoshop image as needed then reduce the image size to close to the max dimensions I need
- Export for Web Legacy - jpeg high @ 60% quality
- Drop exported jpeg into the lovely TinyBeest app https://www.tinybeest.com/ (Mac only)
- Upload TinyBeest-optimised image to PW, often output with MarkupSrcSet https://modules.processwire.com/modules/markup-src-set/ template code
Every time I used $image->webp->url I got a jpg file with great quality. Only got webp when I uploaded the original image, often MB's huge.
Bit frustrating that my images still get scored down on Google Page Speed Insights for not being webp - but then they'd be bigger and take longer to download ?
-
1
-
Good pick-up @wbmnfktr!
/site/init.php is different to /site/templates/_init.php
I guess the custom of using ready.php is that by that time, PW knows about the current page which in this case, is referenced in the hook.
-
2
-



How to handle multi-user multi-task scenario?
in General Support
Posted
@Kiwi Chris not sure I got all that but I had a scenario where what users could see depended on their roles, ie different data sets. I achieved this with RockFinder (now is RockFinder2). Maybe @bernhard can help?