Jump to content

adrian

PW-Moderators
  • Posts

    10,902
  • Joined

  • Last visited

  • Days Won

    349

Everything posted by adrian

  1. Maybe the files in the site/templates folder are not readable - do you have debug mode turned on?
  2. Sounds like a great idea. I would still perhaps suggest Pages::added, rather than Pages::published though - what does everyone else think?
  3. Good point - sorry, I didn't think of that, but what about using "added" instead?
  4. 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.
  5. 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!
  6. 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.
  7. 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
  8. @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?
  9. 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.
  10. 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.
  11. Just echo $q where you want it: echo "Search results for $q";
  12. $q contains the search term: https://github.com/processwire/processwire/blob/57b297fd1d828961b20ef29782012f75957d6886/site-beginner/templates/search.php#L20
  13. Hi Ivan - without seeing the form code I don't really have any suggestions at the moment. Any chance the site is accessible to me to take a look?
  14. Hey @Macrura - not much help I know, but I thought I should mention that I have one site hosted with Site5 and haven't had any problems like this. PS - nice "Tracy Settings" link
  15. It should be easy to modify it so that if a template (defined by the user in the module settings) already exists to use it. If you send a PR directly to the main repo (Nicos), I can merge it for you.
  16. Hi @quickjeff - did you set the template details on the config page of the MigratorWordpress module? It looks like even though it should use the template you defined, it will use "Basic Blog Page" as the label for the template - see here: https://github.com/adrianbj/MigratorWordpress/blob/fa8c54485f230db39c7fb5f5a42c6f1b5a3d27a9/MigratorWordpress.module#L279 Maybe it's not possible to use existing templates with the MigratorWordpress module - I need to check more thoroughly to confirm. If that's the case, it should be an easy fix though.
  17. Thanks again @RDC - I am wondering if perhaps you'd consider submitting a PR to the Flourish guys - seems like it would be a good change for all their users. Once it is in their repo, I'd be happy to include the updated version in this module.
  18. Hi @RDC - thanks for the update. I just took a look at the Flourish lib's github page and it looks like there is now a PHP 7 branch so maybe there is life in the project. I know you aren't using PHP 7, but I would still be curious if this new version works for you. You can grab the required flourish files here: https://github.com/flourishlib/flourish-classes/tree/php7-compat-plus-misc-fixes Please let me know how that goes.
  19. Would mind posting an issue on Github about the two issues noted above so we know that Ryan will see it? Thank you!
  20. Glad it worked for you Remember that $field->name is going to refer to things like "body", "headline", etc so it's actually calling: $item->body which returns the value of the body field. The use of $item->fields is like $page->fields which is mentioned in the docs and cheatsheet. Shameless plug, but I really find the Console panel in Tracy Debugger an incredibly useful tool - it lets you try code and dump objects and arrays in a nicely formatted way - it really helps the learning process.
  21. I think perhaps I am not understanding what you are looking for, but does this suit your needs? foreach($page->my_repeater as $item) { foreach($item->fields as $field) { echo $item->{$field->name}; } }
  22. Lots of info and links about how to handle this - there is more than one approach, so worth reading so you get a better understanding of what is going on:
  23. @homma - here is some reading on this issue: https://github.com/processwire/processwire-requests/issues/56 (sorry, @Gideon So already linked to this)
  24. @Zeka - that's correct - it is only for one branch. To restrict to more than one is a more complex task. Here are a couple of gists that will get you going: https://gist.github.com/adrianbj/e391e2e343c5620d0720 https://gist.github.com/adrianbj/6fd1b770d9ce7a7252b6 Remember there are lots of things that AdminRestrictBranch takes cares of that you will need to consider like adjusting breadcrumbs, admin search results, the Pages > Tree menu, etc if you choose to start with one of these gists. The biggest issue with the "HideUneditablePages" gist module is if an editable page has an uneditable parent - how should that be handled? Anyway, hope one of them gets you going. This is the thread that led to those gist modules:
×
×
  • Create New...