• Content count

  • Joined

  • Last visited

  • Days Won


abdus last won the day on May 3

abdus had the most liked content!

Community Reputation

275 Excellent

About abdus

  • Rank
    Sr. Member

Contact Methods

  • Website URL

Profile Information

  • Gender
  • Location
    Istanbul, Turkey
  • Interests
    Web development, gymnastics, photography

Recent Profile Visitors

1,048 profile views
  1. Hey @joer80, I've been dealing with finals/graduation/masters applications lately and cannot spend as much time coding as I would like. Because of this I haven't been active in the forum for the last two weeks as well. However, hopefully tomorrow, after submitting a project which filled my last three weeks, I'll be finished with school (for now) and be able to go back on coding. Once I get a usable beta going, I'll open a topic for the updates and feedback. Thanks a lot for your interest. Abdus.
  2. I've been using ShareX for the screencasts, but it can't handle high DPI screens very well (might be ffmpeg's fault, though), and cursor is offset a bit. Just tried LICEcap, it seems to work on high DPI screen just fine. I'll use this one from now on. Thank you very much for the suggestion @bernhard!
  3. I can't write a working example yet (on mobile) but if you're comfortable with hooks, you can hook into Page:addable and return false (change $event->return) or throw error when the page ($event->object) has more than 2 parents ($page->parents->count)
  4. For simple json outputs, you can use WireArray::explode and json_encode() or wireEncodeJSON() methods https://processwire.com/api/ref/wire-array/explode/ $myPages = $pages->find('template=basic-page'); // extract required fields into plain array $data = $myPages->explode(['title', 'created']); echo wireEncodeJSON($data);
  5. You can use url segments to achieve this.
  6. Also here's a relevant post from the blog on why it's implemented. https://processwire.com/blog/posts/processwire-core-updates-2.5.27/#php-5.6-and-debuginfo
  7. It appears that your Apache settings don't allow Content-Type headers due to misconfigured modsecurity. I'm not well versed in .htaccess, but you might be able to override security settings using .htaccess file. This SO answer might help. http://stackoverflow.com/questions/28984089/htaccess-allow-all-sorts-of-content-types
  8. Page cache under /site/assets/cache/Page might help as well, but it has to be there in the first place. Running a php script to backup the DB & force download the resulting sql file can help. Of course, this assumes that the DB is accessible using the credentials in config.php
  9. Module

    This was bothering me when I was working on this question about PageTables. It appears that Tracy isn't included when page is called via a modal. Check this out // /site/modules/TracyDebugger/TracyDebugger.module public function init() { // ... // EARLY EXITS // modals if(in_array('regularModal', $this->data['hideDebugBarModals']) && $this->wire('input')->get->modal == '1') return; if(in_array('inlineModal', $this->data['hideDebugBarModals']) && $this->wire('input')->get->modal == 'inline') return; // ... } We need you @adrian, come back!
  10. There's a module for exactly these kind of situations. https://modules.processwire.com/modules/connect-page-fields/
  11. Check the developer console on your browser (press F12). Do you see any JS errors?
  12. All your articles are stored in the database. You won't be able to find them in anywhere inside site directory, with or without FTP. You have to login to MySQL through cPanel or by other means to see your articles. How is it broken, are you getting any errors? Can you copy paste / post a screenshot of the error?
  13. Try this $fieldList = $fields->find('type%=PageTable'); foreach($fieldList as $f) { if($page->template->hasField($f)) { // page has the field } } Or simply: if($page->fields->find('type%=PageTable')->count)) { // page has a PageTable field } // check for a specific field if($myField = $page->fields->get('type%=PageTable')) { // $myField of PageTable type exists on this page. } Here I used find() method with a selector for matching type. You can be more specific, or use any other WireArray methods of course. https://processwire.com/api/ref/wire-array/
  14. Ok, so I've completed the first module and a detailed step by step write-up. https://abdus.co/blog/creating-a-simple-and-configurable-module-for-processwire/ It's a markup module that adds tracking code for analytics. It has hooks, hookable methods, and it's translatable and configurable. https://github.com/abdusco/pw-ga-lite Once I make sure it's ready to go, and write a good intro, I'll create a separate post for it.
  15. That makes it clear. I've also found this part from the core inside Wire class. <?php // /wire/core/Wire.php public function wire($name = '', $value = null, $lock = false) { // ... if(is_object($name)) { // make an object wired (inject ProcessWire instance to object) if($name instanceof WireFuelable) { if($this->_wire) $name->setWire($wire); // inject fuel, PW 3.0 if(is_string($value) && $value) { // set as new API var if API var name specified in $value $wire->fuel()->set($value, $name, $lock); } $value = $name; // return the provided instance } else { throw new WireException("Wire::wire(\$o) expected WireFuelable for \$o and was given " . get_class($name)); } } // ... } Here, setWire() method sets the instance. /** * Set the current ProcessWire instance for this object (PW 3.0) * * Specify no arguments to get, or specify a ProcessWire instance to set. * * #pw-internal * * @param ProcessWire $wire * */ public function setWire(ProcessWire $wire) { $this->_wire = $wire; $this->getInstanceNum(); } Another question @LostKobrakai: Does every single object from PW core needs an instance to be set? What classes are instance-critical, so to speak?