kixe

Members
  • Content count

    663
  • Joined

  • Last visited

  • Days Won

    5

kixe last won the day on February 12

kixe had the most liked content!

Community Reputation

936 Excellent

About kixe

  • Rank
    Hero Member

Contact Methods

  • Website URL
    http://qualyweb.com

Profile Information

  • Gender
    Male
  • Location
    Cologne, Germany

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. kixe

    Once I made a nice Fieldtype for this. Please try out http://modules.processwire.com/modules/fieldtype-button/
  2. kixe

    With PW this is only possible for subdomains. $this->config->sessionCookieDomain = '.example.org'; This setting includes: example.org subdomain.example.org
  3. Just to clarify: Usually there is only one instance/ object of ProcessWire which is the ProcessWire boot object represented by the variable $wire. ProcessWire is a child class of Wire. Assuming you are talking about all Wire objects the answer is YES and more: // Access to a wire object from inside a wire derived class: $pages = $this->wire('pages'); // Access to the current ProcessWire instance: $wire = $this->wire(); // Create new wire object inside your ready.php $this->wire('ferry', '/site/translations.php'); Read more: https://processwire.com/api/ref/wire/wire/
  4. kixe

    You can set flags and apply roles allowed to 'view' or 'edit' this field. $field->setRoles(string $type, $roles); // $type = 'edit' or 'view' $field->addFlag(int $flag); $field->removeFlag(int $flag); Reference: https://processwire.com/api/ref/field/ https://processwire.com/api/ref/field/set-roles/ https://processwire.com/api/ref/field/add-flag/ https://processwire.com/api/ref/field/remove-flag/
  5. I have to correct myself. I missed a hook that triggered the 404. Everything is working as expected and as it should work.
  6. Getting wrong header if 404 is triggered inside template file. Calling a not existing page http://example.org/not/existing/page the correct http status header is sent: 404 Page Not Found The following code inside the template file renders properly page with id=27 but sends header 200 OK instead of 404 throw new Wire404Exception(); Would like to see 404.
  7. Tried to add an item to an array, which is a page property. The common way doesn't work. Is there a PHP expert out there who can explain that to me? Thanks. $page->prop = array('a','b','c'); $page->prop[] = 'd'; var_dump($page->prop); // output: array(3) { [0]=> string(1) "a" [1]=> string(1) "b" [2]=> string(1) "c" } $page->prop = array('a','b','c'); $page->prop = array_merge($page->prop, array('d')); var_dump($page->prop); // output: array(4) { [0]=> string(1) "a" [1]=> string(1) "b" [2]=> string(1) "c" [3]=> string(1) "d" }
  8. Namespace problem. Somewhere in your files (ready.php?) the namespace ProcessWire is defined. You need to remove this. Don't mix files of installations (PW 3.0.x) using namespace with non namespace installations (PW 2.7 or 2.8)
  9. I tested my code and it works. Maybe there is a namespace issue. Which PW Version do you use? Did you place the code in the right file and folder?
  10. kixe

    Enable debug mode to get the error messages and figure out the problem. in /site/config.php $config->debug = true;
  11. @PWaddict Thanks https://github.com/processwire/processwire/commit/79fa81d8a87a1d026d8f763021b8df191f48a4e0
  12. kixe

    If you need this for the backend (result available in frontend too) you can use FieldtypeMarkup for the result. Grab the code from here: https://github.com/kixe/FieldtypeMarkup Create a hook with your formula and place the code in /site/ready.php The result will be populated after saving the page. /** * https://github.com/kixe/FieldtypeMarkup * FieldypeMarkup as concat field with formula * EXAMPLE * */ $wire->addHookAfter('FieldtypeMarkup::formatValue', function($e) { $page = $e->arguments[0]; $field = $e->arguments[1]; // quick exit if ($field->name != 'result') return; if ($page->template != 'calculator') return; $value1 = $page->inputfield1; $value2 = $page->inputfield2; $value3 = $page->inputfield3; $value4 = $pages->get(12345)->inputfield1; // get value from another page $result = $value3 * ($value2 - $value3) / $value4; // formula $e->return = $result; });
  13. kixe

    Set up a page which just return the cookie banner, put it in an iframe and add it to the other sites. You would have to change (loosen) the x-frame options in your .htaccess file of the framed page to get this work. All-in-all not the best solution.
  14. kixe

    It looks like PW is searching for PHP\CustomHooksForVariations, but this class doesn't exists. Namespace settings ok?
  15. @Fuzzy Place this code in /site/ready.php Create this file if it doesn't exist.