Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by 3fingers

  1. Dai amico mio, for the various conspiracies theories Netflix in enough. Once in a lifetime let's think about generosity and collaboration between people, over and beyond their country statuses :)
  2. I previously omitted some of your code for the sake of brevity, so yes, you can do whatever you want inside each foreach iteration.
  3. I think your selector should be: foreach($pages->get("/files/")->children as $folder) { // code for the first iteration, you are now inside the folder foreach($folder->files as $lagu) { // here you are iterating on the files } }
  4. The first selector looks a bit strange to me. It says: "get the children of the page at path /files/ where its title is the same as the current page I'm on"...mmm. Could you elaborate a bit more? πŸ™‚
  5. Well, I live in Italy, Turin, inside a building 50mt far from an hospital and 20mt of a 24h supermarket. The hospital had 1 decease today and Covid19 is the one to blame for it. The supermarket is overcrowded outside even at 23 a.m. I'm working from home and I cannot go outside without a 'right purpose' and a self-certificate of why I am there. My wife cannot stays home for work and her company produces various cleaning products which are a top-sellers this days... My 4yo son stays with his grandparent all day long, without having the opportunity to play with other kids. My mother is 72 and had, 2 years ago, some lunges problems and now, even though she is fine by now, she is really scared.
  6. Have you got Tracy installed and set $config->debug = true; in config.php? Does your js console got any error?
  7. $config->addHookAfter("Pages::saveReady(template=single-spectacle)", function($event) { $pages = $event->object; $page = $event->arguments[0]; if ($page->soiree_double) { $double = $pages->get($page->soiree_double->id); $double->of(false); $double->soiree_double = $page->id; $double->save('soiree_double'); } }); Does this help?
  8. I was a fan of Uikit (the same framework used in the PW backend) but nowadays I write all my css by myself, for the same reason you've mentioned above (using a framework is a tempting way to use default styles an call it a day). Even though I've not used the the new kid on the block (Tailwind, which claims to be "unopinionated", but I do not agree with that statement) I just prefer to be organized upfront with my scss partials and be consistent with styles during the prototype/design phase.
  9. One of the reason could be that "News" (as a string) is hardcoded inside some selector. Just a quick guess.
  10. Even though not officialy supported by PW3 I've used this module in the past successfully: https://processwire.com/talk/topic/711-release-schedulepages/
  11. <?php $projects = $pages->find("template=project-details, sort=random, limit=3"); if($projects) { $first_project = $projects->child(); // Got the first child // Do something with it foreach($projects->remove($first_project) as $p) { // Do something else with the other projects... } } ?> Not tested but it should work, there are several other methods indeed. Or... <?php $projects = $pages->find("template=project-details, sort=random, limit=3"); if($projects) { $i = 0; foreach($projects as $p) { if ($i == 0) { // First project } else { // Other projects } $i++; } } ?>
  12. ..or if you mean by "folder" a parent container within the tree structure then yes, you need to create a blank template (without a template file) with just a "title" field (since it's the default and mandatory).
  13. 3fingers

    Aaron Copland

    Thanks @Macrura, that would more than enough :)
  14. For one site I made some time ago I've tried to use the following "official" strategy: Blogpost from Ryan / May 31, 2019 but, somehow the fallback didn't work on Safari and IE11. I didn't investigate further because I had to deliver the project and until then I've dropped that feature for now. Your solution looks simple and elegant for me, I couldn't tell the difference against the .htaccess approach (I'm no expert by any mean).
  15. 3fingers

    Aaron Copland

    @Macrura, you deserve them. The table filtering on the list (its reactiveness and the immediate changes on the query strings) and the advanced search would be ideal :)
  16. 3fingers

    Aaron Copland

    Congrats @Macrura, beside the pleasant look and feel of the site I really appreciate the precision and the amount of details within the search pages. I'd love, as a christmas present, and in-depth tutorial/guide on this subject (since, IMHO, you've made the best search pages throughout the years) πŸ™‚ πŸ™‚
  17. $pagefields = $page->getFields(); if(wireInstanceOf($pagefields, FieldtypePage)) { foreach($pagefields as $pf) { echo "<a href='$pf->url'>$pf->title</a>"; } } Not tested, it might work though.
  18. More information here: https://processwire.com/docs/start/api-access/
  19. Thanks @bernhard, I'll dig it deeper with your suggestion, even though it seems like their rates are way too high for my project. @psy Nice module! I'd love to use it to complete this task, looks like it could let me easily list files of a dropbox folder into my site. How to share, instead, just some specific files (belonging to the dropbox folder) to a specific user? The ideal situation would be: 1) My client (whom is the one has access to the dropox panel and can upload files) decide to share just few files to user "x" (user "x" has previously registered to my pw site and has a private page). 2) Choosen files appears as links on the private user page ( I've noticed this on the thread you posted, but it's just part of the job). One solution that comes into my mind would be to copy/paste such file links to a repeater belonging to the user page and iterate it on the front-end.
  20. Hey all, I'm here to ask for help about a request a client made me today. He needs a private document area (for all registered users) and, furthermore, a private page (one per single user) holding specific documents belonging to the user itself. I could code it by myself, but I already know that - sooner or later - more features (like filtering by document type, dates, and whatnot) will be asked by my client and....the $$ budget will not suffice the request. So, here is the real question: Do you know an external service (thinking about Dropbox, Box, etc.) which would let me "easily" do the following: - User registers on my site and those credentials are used to also create a new user account on the third party SaaS (via api). - On his private page (on pw site) he can then have 2 links: one for the shared folder (on SaaS site) and one for its private folder (on SaaS site). Any clue? πŸ™‚
  21. What about using $page->addStatus(Page::statusLocked); on the first save occourence? So when a page belonging to a survey is first saved, the next time is accessed it would have a status "locked". I'm not sure if your "admin" user also corresponds to a "super-user" role. In that case I would suggest assign to him a different role, in which case you should dismiss the hook logic and define granular edit permissions for those survey pages.
  22. Even though I appreciate the idea of PW themes I think they would be somewhat limitating, fighting with the power of PW, where having your personal markup gives you freedom and uniqueness to projects. Pure HTML themes, instead, (not being bound to strict fields/relations) might be more appealing to me. If your goal is to make some revenue with them be aware that the market if fully saturated πŸ™‚ My two cent here, of course πŸ™‚
  23. You right! Passing them directly to the renderPager() method now works. Just to clarify, SearchEngine settings kick in, but not those dedicated to pagination πŸ™‚ Thanks @teppo, glad you're on the same time-zone as mine, you're always super fast πŸ™‚
  24. Hi @teppo, another gentle question for you πŸ™‚ I'm trying to style the pagination, using this code: $config->SearchEngine = [ // This are the settings I already used, successfully, elsewhere in the site to style my pagination. 'pager_args' => [ 'nextItemLabel' => "Next", 'previousItemLabel' => "Prev", 'listMarkup' => "<ul class='pagination'>{out}</ul>", 'itemMarkup' => "<li class='pagelink {class}'>{out}</li>", 'linkMarkup' => "<a href='{url}'>{out}</a>", 'currentLinkMarkup' => "{out}", 'currentItemClass' => "current", ], // other settings here stripped out in this example. ]; Those settings seem to be ignored though. I'm surely missing something, can you point me in the right direction? πŸ™‚
  25. I will do that on Monday, in the meantime thanks for your support and kindness :)
  • Create New...