Jump to content

Gideon So

Members
  • Posts

    351
  • Joined

  • Last visited

Everything posted by Gideon So

  1. Hi @franciccio-ITALIANO, Try this great module. http://modules.processwire.com/modules/markup-sitemap/ Gideon P.S. Oops. 1 minute late....
  2. Hi, I have a strange problem as below: Linux box Chrome always serves jpg files instead of webp files but Firefox does serves the webp files. Mac Bookpro Both Chrome and FireFox serve jpg files only. Any clues?? Gideon P.S. Solved. Seems like it is a browser cache problem.
  3. Hi @Jim Bailie, You can use a page reference field. Gideon
  4. Hi @stanoliver, Try if($page->path == "/categories/cars/") { Do your thing here. } Gideon
  5. Hi @franciccio-ITALIANO, Welcome to the forum. If you want to show a image from a image field that set limit to 1 image per field, please try <img style="float:right;" class="attention-img-popup" src="<?php echo $page->images; ?>" alt=""> You can read more imfo about image field here: https://processwire.com/docs/fields/images/ Gideon
  6. In case someone need the solution: wire()->addHookBefore('Pages::saveReady', function ($event) { $page = $event->arguments(0); if(count($page->pageBanner)){ $page->of(false); $page->pageBanner->first()->focus([top],[left]); $page->of(true); } }); Gideon
  7. I see. Learn a lesson. Thanks @Robin S Gideon
  8. Is it possible to set page image focus through a hook?? I tried this piece of code but it seems doesn't work. wire()->addHookAfter('Pages::saveReady', function ($event) { $page = $event->arguments(0); if(count($page->pageBanner)){ $page->of(false); $page->pageBanner->focus(10,10); $page->save(); $page->of(true); } }); Processwire throw this error: Any ideas is much welcome. Gideon
  9. I got your idea wrong. Let me see.... $randomPages = $pages->find("your selector here")->shuffle(); foreach($randomPages as $randomPage): foreach($randomPage->repeater_field->findRandom(3) as $item) : Output endforeach; endforeach; Use findRandom() instead of getRandom().
  10. Please try $randomPage = $pages->find("id=1049|1053|1055|1059|1152")->findRandom(1); Don't use get. Gideon
  11. Hi @Tyssen. for($i = 0; $i < 5; $i++): $randomPage = $pages->find("your selector here")->findRandom(1); foreach($randomPage->repeater_field->getRandom(3) as $item) : Output endforeach; endfor; Hope this helps.
  12. Hi @gregory, Can you tell me more about your template settings?? Are you using the pro module: repeater matrix?? https://processwire.com/store/pro-fields/repeater-matrix/ Gideon
  13. Hi @gregory, Is "case_studies" is a repeater or repeater matrix field?? Gideon
  14. Hi @gregory, What is the field type of "type"?? Please provide more info about your template and field settings. Gideon
  15. Hi @hollyvalero, Maybe you can try $yourArray->eq() to get the item you want. Can't give long example. Please take a look on the doc here: https://processwire.com/api/ref/wire-array/eq/ Gideon
  16. Yes. You can try it out yourself. Gideon
  17. Hi, The alternate user template approach @adrian mentioned is the way to go. Actually, it really depends on what you want to do. For me, I added fields to the user template and it is good enough for me. I put a page reference field in the user template and another field in some other template that need to store user id. Then connect the two page reference fields with the connect page fields module. It works great for me. Gideon
  18. Hi @joer80, 1. Go the Setup --> Templates, click Filters. Then set "show system templates" to Yes. 2. Click "user" template 3. click Family tab 4. set "May this template has childern" to Yes. 5. set templates allowed for this template if necessary. But please think twice before you do this. It is not encouraged to add children to user page. It is better to create a separate page with page reference field that set to choose from user pages. Gideon
  19. Hi @louisstephens, <link rel="icon" type="image/png" href="<?php echo $config->urls->templates?>favicon.png" /> There is no need to add a splash before favicon.png. Gideon
  20. You can go to the support forum to ask for help. Gideon
  21. I suggest you to upgrade to 3.0 if no other reason prevent you from doing it. All the fixes was pushed to the 3.0 branch and as far as I know 2.8 branch is no longer updated. Gideon
  22. Hi @oflcad, Welcome to the forum and the world of Processwire. Do you mean that you need to move the development site to a production server?? If so, there are several ways to do it. 1. Export the datebase and import it to the production server then upload the whole site to the production server. Please amend the site/config.php file as needed if database name, database username and password are different from your development server. You also need to amend the $config->httpHost in the config.php file to the production domain. 2. Use the miration module. and there is a blog post about it. Hope this helps. Gideon
  23. A quick thought: make a subdirectory within the old site and develop the new site there. Delete all the old stuff (remember to leave the new site directory). Then move everything in the new site directory to the main directory. Done. Gideon
  24. Hi, 1. PHP notice is not error. Your code still valid. 2. Try change the line if displaying image to the following: <?php echo $member->images->first()->url; ?> Gideon
×
×
  • Create New...