Jump to content

arjen

Members
  • Posts

    1,222
  • Joined

  • Last visited

  • Days Won

    8

Everything posted by arjen

  1. Are you intentionally bootstrapping ProcessWire? The selector string can be a normal string, but since a while you can use arrays too. But using arrays is more advanced. So stick to simple strings for now You selector should work, but you use case is now clear. Is the get variable being set? What does ... echo $theSiteName; ... say?
  2. @Juergen To setup a cronjob is really easy, but you have to understand some basics first. The cronjob past has nothing to do with ProcessWire. It is a separate program running on your server which is able to run commands at a certain time. It is either configured in your hosting admin panel (easiest, ask your hosting provider) or you can set-up it yourself through the command line. You can follow this example if you're running a Linux based server. You need to understand that you can execute a PHP file from the command line. Teppo has provided us with such a script that will activate the link checker. The file is "/ProcessLinkChecker/Init.php". This is the one the cronjob needs to run. If you are unsure what the correct path is you can ask your hosting provider or login into the shell and navigate to the "ProcessLinkChecker" folder and type "pwd". That will give you the current path. It will be something like: /srv/username/apps/appname/public/site/modules/ProcessLinkChecker/ Combine the path with your new knowlegde from the tutorial and you can set it up. p.s. If you are on Windows you need to create a "Task" in "Windows Task Scheduler". p.s. 2 You don't have to wait to test if the link is working since you can test the script by running: /usr/bin/php /path/to/site/modules/ProcessLinkChecker/Init.php >/dev/null 2>&1 p.s. 3 this whole timing stuff can be pretty confusing so use a tool like crontab.guru. p.s. 4 after proofreading this post now it seems pretty hard , but believe me after a few times you can set it up in a few minutes.
  3. @theo you can remove the module row (something like SessionHandlerDB) from the modules table in your database with a tool like phpmyadmin.
  4. Also, you can temporary removing SessionHandlerDB and see if that might be the culprit.
  5. Hi Tim, What is the structure of your tree? I've read your question twice, but can't seem to understand what you mean. You can sort by subfields like: $pages->find("template=test, sort=parent.title, sort=page_field.sort"); Perhaps that is what you are looking for?
  6. Hi, What did the MySQL logs say?
  7. Hey, Sorry to hear. Most hosting companies will tell you that the system is running fine (developers: it's the system. operations: it's the application). Have you looked into the server logs by apache or mysql? Ask the hosting provider how they know it is being caused by ProcessWire. Is there enough ram?
  8. Thanks for your honest reply Mike.
  9. Thanks GuruMeditation, couldn't find the right topic. Seems understandable where they are coming from. WordPress does have some choice of prefabricated community plug-ins. If you aren't a developer or if there is no business case for custom development the choice is obvious. Hopefully they won't get hacked
  10. Hi, I was just browsing cmscritic.com and noticed that it felt quite slow. Looking at the source it seems that they moved back to WordPress? Does anyone know what motivated this move?
  11. You need to add the checkbox in the backoffice. Then you need to do some PHP stuff. It might seem fancy, but believe me it's quite easy once you'll get a hold of this hooking stuff. Create a ready.php in your /site/ folder. Then place this: <?php // You can hook into the saving process => https://processwire.com/api/hooks/ $pages->addHookAfter('saved', function($event) { // We grab the current object (the page being saved) and store it in $page $page = $event->object; // Only run this script on training templates if ($page->template !== 'training') return; // Only run this script on empty dates if (!empty($page->training_start)) return; // Save field hasdate_checkbox and set value to checked/1 $page->setAndSave('hasdate_checkbox', 1); }); Written in browser, so not tested. But following the links provided above you will get an idea.
  12. Hey Hendrik, In this thread you'll find different solutions. No pun intended and I don't know if you've searched, but next time you could try Google first. The forum is loaded with great examples. Try some variations on keywords.
  13. No problem mate, always happy to help. Be sure to checkout this thread as well with more examples.
  14. Hey mr-fan, If I understand your case correctly you could use implode() instead of your if else / foreach so you'll save the a few lines. Makes it more readable too: echo wire('page')->field_name->implode(', ', 'title'); // This will produce title1, title2, title3, lasttitle
  15. It might give more insight if there are warning or errors when loading another page with the same template under the same parent. Perhaps it'll give more info. Recently I had a Page field with "Custom PHP code to find selectable pages". ProcessWire gave a warning on one page since it had no value, but an internal server error on another page which had a value. Without Tracy this was really hard to debug. You could also check in the database if there is strange stuff going on in the fields being used.
  16. Strange you see 2 pages whereas one is being used. Perhaps the other is in the trash? Can you edit/create other pages with the same template under the same parent? Also try Tracy Debugger. That will give you more info.
  17. Hey Christoph, That's very limited information to provide hints. Is the template using page fields? What fields do you use? Can you edit/create other pages with the same template under the same parent? Does the same error occur on your local environment? Have you turned on $config->debug in /site/config.php? That will hopefully give you more information on what is causing the error.
  18. Also you might want to look into building a selector with arrays, since that is more readable. And if you only want to count the pages, you could also use the count method. That is blazing fast. We're calling more than 80 count method on one pageload searching around 40k pages and it is loads within 1 second.
  19. Just switched back to ST coming from Atom (so nice, but so slow). ⌘ + P = Go to anything.
  20. Hi blacksrv, Sorry you got no answers to your question. Perhaps some people (including myself) have trouble understanding your problem. Could you describe it more verbose? For example: what are internal pages? What kind of error do you get? What are you trying to achieve?
  21. Just laughed my ass of again
  22. That the css way. You can also use php to achieve this: $i = 1; foreach($page->repeater_field as $repeater) { $i++; // 2, 3, 4, 5, etc $odd = $i % 2 == 0; if ($odd) { echo "<div class='item-$i item-odd'>"; // Use .item-1, .item-2, etc to style /* OR */ echo "<div class='item-$i item-odd' style='background:{$repeater->color_field}'>"; // Or use a the color field by soma to select color in repeater echo $repeater->text; // Left echo $repeater->image; // Right echo "</div>"; } else { echo "<div class='item-$i item-even'>"; echo $repeater->image; // Left echo $repeater->text; // Right echo "</div>"; } } This could be written less verbose, but I think it gets the point accross.
×
×
  • Create New...