-
Posts
11,112 -
Joined
-
Last visited
-
Days Won
365
Everything posted by adrian
-
More improvements to the Captain Hook panel which I think now makes it the definitive source for browsing and understanding what each hook does. You have always been able to click the line number to open the file to the line of the method in your code editor (if you have things set up correctly), but this new version adds the following two new features: 1) Inline documentation for each hook - click method (last column) to expand/collapse the docs: 2) Direct link to PW API reference (from the Class::method link in the first column), eg clicking on "Pages::saved" will take you directly to this page:
-
It sounds to me like things are being lost in the redirect to Paypal and back. Paypal should return most things back to you so you can grab them again. What I do is create and populate a PW page with the user's details, submit them to Paypal for payment, and then on return I can look up the user by an ID that I assign to them (stored in their page and also sent to Paypal). With that I can update their page with the payment details (verification of payment, etc). This of course does result in some entries which weren't finalized - sometimes people choose to back out at the last minute, but at least you have more info on this. Also, getting OT here, but are you making use of Paypal's IPN system (https://github.com/paypal/ipn-code-samples/blob/master/php/PaypalIPN.php) to verify payment?
-
I am not sure how you are getting from the page that sets the $_SESSION into PW. Are you using a header redirect from one to the other? Maybe you could bootstrap PW in the non PW page that collects the $_POST data. Then you could make use of $session in that non PW page. Maybe you could use a cookie instead?
-
Not sure why that isn't working, but the PW API has it's own $session variable: https://processwire.com/api/ref/session/ at you can use.
-
You could use the API, or the AdminActions module's Page Maniplulator action. Maybe with settings like this:
- 21 replies
-
- 7
-
-
A couple of new tutorials: https://webdesign.tutsplus.com/tutorials/processwire-admin-theme-strategies--cms-29244 https://digitalardor.com/articles/basic-setup-for-content-blocks-in-processwire/ and a Slant list showing PW as the best PHP CMS with currently no down votes https://www.slant.co/topics/5409/~php-cms
-
Pages::setupNew won't work for this because the page doesn't exist yet when you try to sort it to the first (0) position.
-
Ah - the old windows vs linux case issues I guess
-
Sorry about that - should be fixed in the latest version.
-
force all images on the site to get re-sized again
adrian replied to maxf5's topic in Getting Started
Speaking of horst: https://modules.processwire.com/modules/pageimage-remove-variations/ -
ProField Table Compatibility with Processwire 2.7.x
adrian replied to Alex CA's topic in General Support
Ryan keeps old versions available from the download page. You should have no problem running those older versions on PW 2.7, but you will miss out on some features, like pagination in the Table field.- 2 replies
-
- 1
-
-
- processwire2.7
- profiled
-
(and 1 more)
Tagged with:
-
Just pushed a new version which has the following improvements: Console panel calls now process /site/ready.php and /site/finished.php (along with /site/init.php which already worked) - thanks to @bernhard for help testing this. Captain Hook panel now sorts hooks alphabetically within each file/class, rather than the old order by line number in the file - this makes it much easier to browse. Updates to Ace editor (used in the console panel) and the Tracy core. Some other tweaks. Cheers!
-
So please turn on debug mode and see what it says. Also, just check the permissions of the template files to make sure they are readable.
-
Maybe the files in the site/templates folder are not readable - do you have debug mode turned on?
-
Sounds like a great idea. I would still perhaps suggest Pages::added, rather than Pages::published though - what does everyone else think?
-
Good point - sorry, I didn't think of that, but what about using "added" instead?
-
Examples of large sites, particularly government, desperately needed
adrian replied to Margie's topic in Getting Started
A few government / university sites for you: This one is currently mostly US government (https://ecoreportcard.org/), but there is one report card for by the Brazilian government (https://ecoreportcard.org/report-cards/guanabara-bay/about/) and another for the World Wildlife Fund (WWF) and the Columbian government (https://ecoreportcard.org/report-cards/orinoco-river/about/). And there will be more international ones to come in the future. This site has quite a deep hierarchy. This one is a Maryland State Government and University of Maryland initiative: https://chesapeakebaystory.umces.edu/ This is a US and Australian government combined education initiative: https://usaus-h2o.org/ (it's looking pretty old now - it was actively used for a 3 years, but is abandoned, for now at least). Another one for Maryland government and other universities and agencies: https://madeclear.org Hopefully there are some useful examples for you there. -
Hope you're still enjoying Windows 3.1 then Sorry I couldn't resist ... ha ha ha - not really very funny I know We are obviously getting way OT, but I guess the key thing for me is that there is now an option with $pages->sort() to easily add reverse order functionality after a site is already set up if we decide it would be a better UX. I like having options!
-
Sure, but why not update the site to 3.x or at least 2.8 I have updated all my old sites and most involved no code changes. Only a couple of sites needed some work with bootstrapped ajax calls etc, but that was it. Just so you know, I am not trying to say that this module should be removed, but perhaps it might be possible to say it is no longer required with PW 3. Obviously a little more testing would be beneficial - just wanting to start the dialog.
-
I haven't tested at scale, but Ryan notes: https://processwire.com/blog/posts/pw-3.0.46-stocking-stuffers/#new-pages-api-manipulation-methods
-
@horst - what do you think - does the use of the new sort() method in a Pages::saved hook (like my example above) make this module obsolete or is there another scenario I am not thinking of?
-
Yeah, I agree that it sounds like it should take care of it (and it appears to work just fine), but I guess I am wondering what the point of this is: // re-build sort values for children of $page, removing duplicates and gaps $pages->sort($page, true); Why would there be duplicates/gaps in the first place if the main sort() method works as expected? Maybe it's to clean things up if you did some manual changes? I am really not sure, but it seems like it shouldn't be necessary.
-
Based on the suggestion by @abdus, put this in your ready.php file: $this->addHookAfter("Pages::saved", function($event) { $this->pages->sort($event->arguments[0], 0); }); Note that $event->arguments[0] returns the page that was just saved. Perhaps it would be a good idea to resort all other children too - have a read more about this here: https://processwire.com/api/ref/pages/sort/ I think in this use case you'd actually want to use the parent of the saved page so that all child pages are sorted. I honestly have played around with this, so not sure if it matters or not.
-
Echo the searched term with search results (solved)
adrian replied to ryanC's topic in Getting Started
Just echo $q where you want it: echo "Search results for $q"; -
Echo the searched term with search results (solved)
adrian replied to ryanC's topic in Getting Started
$q contains the search term: https://github.com/processwire/processwire/blob/57b297fd1d828961b20ef29782012f75957d6886/site-beginner/templates/search.php#L20