Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/13/2017 in all areas

  1. Populating a hidden "sort path" field computed from a page's parents in a saveReady handler should solve this. If your categories are sorted alphabetically, just store the full path, if not, assemble it from the parents' sort values with every value sprintf'd to identical, zero-padded length so alphanumeric sorting works.
    5 points
  2. Hi, does @ryan or anyone else have anymore progress or opinion on this, as i think it is a somewhat polarising subject. I believe having lots of different stores would be bad for processwire (as im not very keen on using the https://processwireshop.pw/ store). It would be preferable to have a one stop shop for all modules including premium IMO.
    4 points
  3. Feeling the love for ProcessWire today. Two sites launched and owners over the moon happy. Two additional sites ordered by existing clients and both specified ProcessWire as the platform. New sites: 1. https://flywithmehorses.com.au/ Owner is just starting out in business and had already spent $100's dollars and 6+ months on a 'free' website without success. She helped me so I sponsored development of her site. Client's comment: "OMGOSH this is sooo exciting!!!!!!! YAY!! Thank you alot!!!!! Can't wait to tell everyone!!! THANK YOU!!!" ProcessWire 3.0.63 2. https://cttcfilmcourse.com/ Original site built in WordPress. Over 1000 lines of code on the home page and the https://validator.w3.org/ bombed out at line 124 with "Too many errors". Google's page speed insights were cringingly bad. Project was to keep the visuals and rebuild the site in PW with a solid foundation. Job done. No validation errors and vastly improved page speed insights. Also added search and better site navigation. Client's comment: "So good!" ProcessWire 3.0.63 Looking forward to working on the next two sites, both of which will be website apps with workflows rather than informational sites. As ever, grateful for comments/feedback to improve either site.
    2 points
  4. $coaches = $pages->get("/coaches/")->children($selector);
    2 points
  5. @Sipho, the name tip only appears if $config->debug = true
    2 points
  6. This is because as the inventor says: "ProcessWire IS a native category system, whether by structure or relation. I think the distinction is that we don't call them "categories" or "tags". But "does not have" makes it sound like they aren't part of the plan. When in fact, it's one of the underlying purposes of the system." to read more:
    2 points
  7. So after looking at and looking at my data again I came up with the following structure: The structure is families -> family -> subfamily -> genus -> species This is how I originally thought of doing it, but I thought it would cause problems when I wanted to add new species and filter data. However, I have now realised that having a good page structure is very desirable. This way, people can link to the individual categories or browse through them but I can still have a separate page that references them and can filter through them. Thanks for the help! Also, I am loving how easy it is to use ProcessWire! It's much better than something like WordPress for a task like this. I don't have to constantly fight the system
    2 points
  8. I woke up this morning and this was the very first forum topic I had read. I was really happy to start the day with a ProcessWire success story, it made my day. Thank you for sharing it with us and keep up the good work! Cheers from the other side of the Globe
    2 points
  9. NOTE: This thread originally started in the Pub section of the forum. Since we moved it into the Plugin/Modules section I edited this post to meet the guidelines but also left the original content so that the replies can make sense. ProcessGraphQL ProcessGraphQL seamlessly integrates to your ProcessWire web app and allows you to serve the GraphQL api of your existing content. You don't need to apply changes to your content or it's structure. Just choose what you want to serve via GraphQL and your API is ready. Warning: The module supports PHP version >= 5.5 and ProcessWire version >= 3. Links: Zip Download Github Repo ScreenCast PW modules Page Please refer to the Readme to learn more about how to use the module. Original post starts here... Hi Everyone! I became very interested in this GraphQL thing lately and decided to learn a bit about it. And what is the better way of learning a new thing than making a ProcessWire module out of it! For those who are wondering what GraphQL is, in short, it is an alternative to REST. I couldn't find the thread but I remember that Ryan was not very happy with the REST and did not see much value in it. He offered his own AJAX API instead, but it doesn't seem to be supported much by him, and was never published to official modules directory. While ProcessWire's API is already amazing and allows you to quickly serve your content in any format with less than ten lines of code, I think it might be convenient to install a module and have JSON access to all of your content instantly. Especially this could be useful for developers that use ProcessWire as a framework instead of CMS. GraphQL is much more flexible than REST. In fact you can build queries in GraphQL with the same patterns you do with ProcessWire API. Ok, Ok. Enough talk. Here is what the module does after just installing it into skyscrapers profile. It supports filtering via ProcessWire selectors and complex fields like FieldtypeImage or FieldtypePage. See more demo here The module is ready to be used, but there are lots of things could be added to it. Like supporting any type of fields via third party modules, authentication, permissions on field level, optimization and so on. I would love to continue to develop it further if I would only know that there is an interest in it. It would be great to hear some feedback from you. I did not open a thread in modules section of the forum because I wanted to be sure there is interest in it first. You can install and learn about it more from it's repository. It should work with PHP >=5.5 and ProcessWire 3.x.x. The support for 2.x.x version is not planned yet. Please open an issue if you find bugs or you want some features added in issue tracker. Or you can share your experience with the module here in this thread.
    1 point
  10. Hi everyone, I'm proud to share my first fieldtype module and I think it's a quite handy one It helps you to create all kinds of table/matrix inputs very quickly and easily. You have loads of options for customizing your field via plain javascript. See the handsontable docs for that Please consider this module ALPHA until i got some more time to test it. Any help would be highly appreciated Numbers are for example always tricky. Different locale settings, different types, rounding errors and so on... Download: https://gitlab.com/baumrock/FieldtypeHandsontable Result: Installation/Configuration: Just install the Fieldtype, add a field to your template and set the handsontable options in the fields details. If you have InputfieldAceExtended installed you will also have code highlighting for your code: Get data: If you retrieve the data from the API with outputformatting ON you have some helper methods available: getData() + getRows() get all data of the field getRow($row) get one special row, eg getRow(1) or getRow("2017") getCols() get all data but by columns not by rows getCol($col) get one special column, eg getCol(1) or getCol("mycolumnheader") You can also access rowHeaders and colHeaders directly (see examples) Simple Example: Caution: the examples below are outdated! see this post:
    1 point
  11. thank you robin, it worked! still i would like to know what's going on and why it does not work as expected...
    1 point
  12. Sounds pretty similar to what someone else was asking. You can do something like this with Page Table or Page Table Extended:
    1 point
  13. Just wanted to add another report of non-well formed numeric values occurring with PHP 7 (specifically 7.1.7). Pmichaelis' solution works, but only allowed the caching of a single CSS and JS file for my entire site, while Adrian's (several posts above) works and allows for several of each. That said, AIOM still breaks when a template calls for a file that hasn't been previously generated with either of those solutions and remains so even on a reload when a cached file should be available. To get that original page working, I need to jump to a different page using that template (which renders correctly) and then back to the original page. Edit: ...and by break, I mean it adds a string error message (with some HTML) to the SRC path for each item in your array, so the browser tries to load the CSS or JS file at a URL consisting of multiple error messages followed by the correct path in one epically long string.
    1 point
  14. hi robin, coming from other cms the widgets seem to be quite common. i created somthing like this some time ago and never needed it again until now. but you will find some useful information here: and here: in the screencast you see it starting at 2:15
    1 point
  15. Hi Peter Can any of these resources/uris be combined into a pattern? If there are 500 resources, I'm sure the tree can be simplified somewhat, albeit aside technicalities such as the difference in how the two platforms create URIs (or if they've been manually set in modx). If you do a sitemap, how will you generate new uris to map to PW Pages? At the end of the day, as long as things match up, I don't see any further issues. Not sure on how Modx works (I tried it once, didn't like it), but keep an eye out for trailing slashes as well. In your specific instance, the 404 monitor is limited to 100 - you'd need to change the code to get it to show more, and that might be client-resource-intensive. JL2 will handle this better.
    1 point
  16. Hi Mike I have a multi-lingual MODX site which I've rebuilt in Processwire. PW site isn't live but is on a test server. As the MODX version currently has around 500 resources (lets say 500 URIs) I am keen to follow the old alleged Abraham Lincoln advice I'm thinking of doing following and wanted to sanity check my approach 1. Get a sitemap of the entire MODX site into a XLS or CSV and import into Jumplinks 2. Manually go through each "old" URL and update to the new URL Am I missing something crucial apart from keeping an eye on Google's Search Console (was Webmaster tools) and watching for 404 hits. I'll enable 404 monitoring on Jumplinks too. Cheers for any pre flight advice.
    1 point
  17. Figured out a slight workaround today using various hooks, it's probably not ideal but seems to work OK. It adds two new fields to every template, the first gives the option to hide view links from pages using that template, the second adds the ability to edit the URL. The following is in my ready.php file: <?php // Helper function to rewrite URLs with dynamic properties // For example {name} will be replaced with the page name property function rewriteURL($page, $url) { $appUrl = wire('pages')->get(1)->link; // Base URL set in home template $regex = '/(?:{([^}]+?)})|(.+?(?={[^}]+?}|$))/'; $out = ''; preg_match_all($regex, $url, $matches, PREG_SET_ORDER, 0); foreach($matches as $match) { if ($match[1]) $out .= $page[$match[1]]; else if ($match[2]) $out .= $match[2]; } return $appUrl.$out; // e.g. http://www.example.com/some-path } // Rewrite page list view URLs $wire->addHook('ProcessPageListActions::getActions', function($event) { $page = $event->arguments(0); $template = $page->template; if ($template->hideViewLink) { $actions = $event->return; unset($actions['view']); $event->return = $actions; } elseif ($template->rewriteViewURL) { $actions = $event->return; if (array_key_exists('view', $actions)) { $actions['view'] = array( 'cn' => $actions['view']['cn'], 'name' => $actions['view']['name'], 'url' => rewriteURL($page, $template->rewriteViewURL), ); $event->return = $actions; } } }); // Rewrite page edit view URLs $wire->addHookBefore('ProcessPageEdit::buildFormView', function($event) { $page = $event->object->getPage(); $template = $page->template; if ($template->rewriteViewURL) { $updatedURL = rewriteURL($page, $template->rewriteViewURL); $event->arguments = [ $updatedURL ]; } }); // Edits the edit page 'View' tab if required // Removes dropdown items $wire->addHookAfter('ProcessPageEdit::getTabs', function($event) { $template = $event->object->getPage()->template; $tabs = $event->return; $editTab = array_key_exists('ProcessPageEditView', $tabs); if ($editTab) { if ($template->hideViewLink) { $tabs['ProcessPageEditView'] = false; } else { $tabs['ProcessPageEditView'] = preg_replace('/<span.*(?=<\/a>)/', '', $tabs['ProcessPageEditView']); } $event->return = $tabs; } }); // Adds extra fields to templates $wire->addHookAfter("ProcessTemplate::buildEditForm", function(HookEvent $event) { $template = $event->arguments[0]; $form = $event->return; $f = $this->modules->get('InputfieldText'); $f->attr('id+name', 'rewriteViewURL'); $f->value = $template->rewriteViewURL; $f->label = $this->_('Rewrite View URL'); $f->description = $this->_('You can access page properties by wrapping them in curly braces.'); $f->notes = $this->_('e.g. {name} will be replaced with the page name'); $form->insertAfter($f, $form->templateLabel); $f = $this->modules->get('InputfieldRadios'); $f->attr('id+name', 'hideViewLink'); $f->addOption(1, 'Yes'); $f->addOption(NULL, 'No'); $f->value = $template->hideViewLink; $f->label = $this->_('Hide View Link'); $f->description = $this->_('If this template should hide view links.'); $form->insertAfter($f, $form->templateLabel); $event->return = $form; }); // Save the extra template fields $wire->addHookBefore("ProcessTemplate::executeSave", function() { $template = $this->templates->get($this->input->post->id); $template->set('hideViewLink', $this->input->post->hideViewLink); $template->set('rewriteViewURL', $this->input->post->rewriteViewURL); }); Also need some custom CSS rules to hide the view link in the dropdown Save button. .pw-button-dropdown .ui-menu-item { display: block } .pw-button-dropdown .ui-menu-item a[data-pw-dropdown-value="view"] { display: none; } Would still be interested in a cleaner solution though!
    1 point
  18. Not sure but I seem to recall reading that either debug mode or advanced mode triggered the field name display when hovering.
    1 point
  19. The first part is intended // https://github.com/ryancramerdesign/ProcessWire/blob/a210ba0b5ea67e56fef8a27a620bcfa6f96ca0b8/wire/templates-admin/scripts/inputfields.js#L999 $(document).on('click', '.InputfieldStateToggle, .toggle-icon', function() { var $t = $(this); // clicked element, either label or the icon var $li = $t.closest('.Inputfield'); var isIcon = $t.hasClass('toggle-icon'); // is the clicked element the icon? var $icon = isIcon ? $t : $li.children('.InputfieldHeader, .ui-widget-header').find('.toggle-icon'); // the icon // initially the $li doesn't have the classes InputfieldStateCollapsed and InputfieldStateWasCollapsed // they are added by clicking the toggle icon var isCollapsed = $li.hasClass("InputfieldStateCollapsed"); var wasCollapsed = $li.hasClass("InputfieldStateWasCollapsed"); if($li.hasClass('InputfieldAjaxLoading')) return false; ... if(isCollapsed || wasCollapsed || isIcon) { // all are false when clicking the label ... // https://github.com/ryancramerdesign/ProcessWire/blob/a210ba0b5ea67e56fef8a27a620bcfa6f96ca0b8/wire/templates-admin/scripts/inputfields.js#L1035 } else { if(typeof jQuery.ui != 'undefined') { var color1 = $icon.css('color'); var color2 = $li.children('.InputfieldHeader, .ui-widget-header').css('color'); $icon.css('color', color2); // the flashing icon $icon.effect('pulsate', 300, function () { $icon.css('color', color1); }); } if(!$li.hasClass('InputfieldNoFocus')) $li.find(":input:visible:eq(0)").focus(); }
    1 point
  20. Another trick as mentioned by @Robin S somewhere I now can't find...Hover your mouse over the field's collapse/uncollapse arrow...the name of the input usually matches the API...
    1 point
  21. Yesterday I released 0.3.1 with the access migrations like described here: It does also include a fix to allow usage in multisite setups using $config->paths->site instead of hardcoding /site/….
    1 point
  22. +1 and it also flashes a few times instead of closing it.
    1 point
  23. @heldercervantes, Completely off topic. I hope that you and your family were not damaged by the recent fires. I have a friend whose family members are still hospitalized; she is recovering from smoke inhalation and the he has severe burns he received while rescuing a dog from a burning building.
    1 point
  24. The sort value is only kept consistent per parent, therefore it doesn't do what you want it to do. You could try using "sort=parent, sort=sort", but this will only solve the issue for 1 level of nesting. For anything further you'd probably need to do some serious joining with pages_parents to even get the wanted sort order in mysql.
    1 point
  25. You don't entirely have to disable it, just fingerprint the browser for instance. There are several options. See this commit in wire/config.php by ryan.
    1 point
  26. Maybe this works...? return $page->getFormatted('title');
    1 point
  27. @Margie, it's likely that the error you're seeing is due to interference by the mod_security Apache module. Ask your host to disable mod_security and it should resolve your issue.
    1 point
  28. Updated to Version 1.0.3 with one more Inputfield Option which allows to use any custom JavaScript.
    1 point
  29. @PWaddict I'm not really sure why you would bind your translations to the page object. What if you want to use those in a context, where there's no $page variable present? Wouldn't it be better to just create a new WireData object (like $static_translations) and return that.
    1 point
  30. were you able to figure out your problem? i am having the same issue with the latest version of processwire
    1 point
  31. There are long-standing issues with the $user page having output formatting off by default - there are a number of forum topics where it has come up. I'm not sure if it's deliberate or if output formatting is off consistently for $user, but you could use $user->getFormatted('date') to be sure. Related topics:
    1 point
  32. Yes it is indeed an option and nice to have but i would vote for opening the official store for 3rd party module developers. Please consider this @ryan It would motivate more professionals to develop amazing modules for ProcessWire. For newcomers it would be easier to actually find the plugins they need. I usually prefer paid modules because I feel more safe when it comes to support / updates. (But currently I'm forced to use some weird unofficial selfmade stores which is not supporting the feeling of safety and trust that I'm looking for as a customer) Support requests for these modules could go into their dedicated VIP Support Forums just like with Ryan's Pro Modules. (The whole community could benefit from already answered questions easily ...) I could keep going on but I'm sure it is not even necessary. Everyone can make up their own mind on this topic for sure. Just one more thing I want to add: I much prefer to support Ryan with a referral fee for each sold item instead of anyone else.
    1 point
  33. Wanted to let you know, that I had some issues with AOIM running php 7. Error messages were generated because of non well formed numeric values. Maybe the issues are bound to my hosting environment. The following changes resolved them Changend line 775 in /site/modules/AllInOneMinify/lib/cssmin.php to: return intval($size); Changed line 713 in site/modules/AllInOneMinify/AllInOneMinify.module to $_timestamp = intval($_timestamp . $file['last_modified']);
    1 point
  34. Here's an updated version of the script from @horst and @jacmaes This version; Is PW3 compatible (but not 2.7/2.8) Fixes a bug that prevented the $debugIteration flag from working as described Tweaks the output formatting somewhat Adds some stats on pages/images/variations visited (and variations copied successfully) <?php // for PW3+ // (UPDATES by @jacmaes bugfix for $new filename from below post!) // (UPDATES by @netcarver debugIteration bugfix, PW3 compatibility & formatting tweaks) $debugIteration = true; // true to iterate only over the first page with a desired field, false to iterate over all pages $doFilecopy = false; // true to really copy variation files, false for debug purposes $oldFieldtype = 'CropImage'; // CropImage $newFieldtype = 'CroppableImage3'; $timelimit = 120; // per single page // bootstrap PW include(dirname(__FILE__) . '/index.php'); // collect fields and cropsetting names $collection = array(); echo "<ul>"; foreach($fields as $f) { if($f->type != 'Fieldtype' . $oldFieldtype) continue; $collection[$f->name] = array(); echo "<li>{$f->type} : {$f->name}</li>"; $thumbSettings = preg_match_all('#(.*?),.*?\n#msi' , trim($f->thumbSetting) . "\n", $matches, PREG_PATTERN_ORDER); if(!$thumbSettings) continue; $collection[$f->name] = $matches[1]; echo "<ul>"; foreach($collection[$f->name] as $suffix) { echo "<li>{$suffix}</li>"; } echo "</ul>"; } echo "</ul>"; echo "<hr />"; $pages_visited = 0; $images_visited = 0; $variations_visited = 0; $variations_copied = 0; // now iterate over all pages and rename or copy the crop variations echo "<ul>"; foreach($pages->find("include=all") as $p) { set_time_limit($timelimit); // reset the timelimit for this page foreach($collection as $fName => $suffixes) { if(!$p->$fName instanceof \ProcessWire\Pageimages) { continue; } $images = $p->$fName; if(0 == $images->count()) { continue; } echo "<li>Page \"<strong>{$p->title}</strong>\" <em>directory \"site/assets/files/{$p->id}/\"</em><ol>"; foreach($images as $image) { echo "Image \"<strong>{$image->name}</strong>\"<ul>"; $images_visited++; foreach($suffixes as $suffix) { $variations_visited++; $errors = array(); $dispold = "{$suffix}_" . $image->name; $dispnew = str_replace(".", ".-{$suffix}.", $image->name); $dir = dirname($image->filename).'/'; $old = $dir . $dispold; $new = $dir . $dispnew; $old_present = file_exists($old); $new_present = file_exists($new); if (!$old_present) $dispold = "<strike style='background-color:#F33'>$dispold</strike>"; if ( $new_present) $dispnew = "<u style='background-color:#3F3'>$dispnew</u>"; echo "<li><em>Variation: $suffix</em> — $dispold ⇒ $dispnew"; if($doFilecopy && $old_present && !$new_present) { $res = @copy($old, $new); if ($res) { $variations_copied++; $res = "<span style='background-color:#3F3'>Success</span>"; } else { $res = "<span style='background-color:#F33'>FAILED</span>"; } echo " <strong>Filecopy: $res</strong>"; } echo "</li>"; } echo "</ul>"; } echo "</ol></li>"; if($debugIteration) break; } $pages->uncache($p); // just in case we need the memory $pages_visited++; if($debugIteration) break; } echo "</ul><p>Visited $pages_visited pages.</p>"; echo "<p>Visited $images_visited images.</p>"; echo "<p>Visited $variations_visited variations.</p>"; echo "<p>Copied $variations_copied variations.</p>"; exit(); Looks like this now... Thanks Horst for the detailed instructions and script - and to jacmaes for the testing and update!
    1 point
  35. PHP 7.1 is returning a: A non well formed numeric value encountered on line 713 notice because you are relying on PHP's auto int casting. I didn't do a thorough check to see if this is ok, but so far it's working for me: $_timestamp = ((int)$_timestamp + $file['last_modified']);
    1 point
  36. It would be very easy to change from CroppableImage to CroppableImage3, but the old Thumbnail / CropImage uses a none-conform variation naming. It uses prefix_basename.ext, but since PW 2.5.11 we have basename.-suffix.ext. The way to go would be to use a bootstrap script that iterates over all pages, looking for Thumbnailfields, and if one is found, iterate over all images and (to be save!) in a first run copy the old variations to imagevariations with the new naming scheme. After successfully copied all crop variations, you should make a DB backup!! Than you can install the CroppableImage3 module and change the fieldtype of your images field to point to it. (Do a copy of your croppsettings before changing the type) Now you need to update your template files to use $page->image->first->getCrop('grande') instead of $page->image->first->getThumb('grande') After checking if all works well, you may run a variation of the bootstrap script that delete the old prefix_basename.ext variations instead to copy them to new naming scheme. Then uninstall the old Thumbnail module. As you said it is a lifesite, I suggest to run the bootstrap copy of the variations under PW 2.7 version. This would have no effect on your site. You also may upgrade the Thumbnail module to the CroppableImage (intermediate) module first, what can be done completly under PW 2.7. This way, you would not have to update two parts at once (PW no namespace to namespace, Imagefieldtype from old to new over different naming schemes). Upgrading from CroppableImage to CroppableImage3 is easier. But, if you can lock down your site for 20 to 30 minutes while switching to PW 3, changing images fieldtype and updating template files, it should be save to change from Thumbnail to CroppableImage3 directly. <?php // for PW 2.7 (UPDATED with @jacmaes bugfix for $new filename from below post!) $debugIteration = true; // true to iterate only over the first page with a desired field, false to iterate over all pages $doFilecopy = false; // true to really copy variation files, false for debug purposes $oldFieldtype = 'CropImage'; // CropImage $newFieldtype = 'CroppableImage3'; $timelimit = 60; // per single page // bootstrap PW include(dirname(__FILE__) . '/index.php'); // collect fields and cropsetting names $collection = array(); echo "<ul>"; foreach($fields as $f) { if($f->type != 'Fieldtype' . $oldFieldtype) continue; $collection[$f->name] = array(); echo "<li>{$f->type} : {$f->name}</li>"; $thumbSettings = preg_match_all('#(.*?),.*?\n#msi' , trim($f->thumbSetting) . "\n", $matches, PREG_PATTERN_ORDER); if(!$thumbSettings) continue; $collection[$f->name] = $matches[1]; echo "<ul>"; foreach($collection[$f->name] as $suffix) { echo "<li>{$suffix}</li>"; } echo "</ul>"; } echo "</ul>"; echo "<hr />"; // now iterate over all pages and rename or copy the crop variations echo "<ul>"; foreach($pages->find("include=all") as $p) { set_time_limit($timelimit); // reset the timelimit for this page foreach($collection as $fName => $suffixes) { if(!$p->$fName instanceof Pageimages) continue; $images = $p->$fName; if(0 == $images->count())continue; echo "<li>{$p->title}<ol>"; foreach($images as $image) { echo "{$image->name}<ul>"; foreach($suffixes as $suffix) { $old = dirname($image->filename) . "/{$suffix}_" . $image->name; $new = dirname($image->filename) . "/" . str_replace(".", ".-{$suffix}.", $image->name); echo "<li>$suffix<ul><li>$old</li><li>$new</li></ul>"; if($doFilecopy) { if(!file_exists($old)) { echo "ERROR: original variation is missing!"; } else { if(file_exists($new)) { echo "file already exists"; } else { $res = @copy($old, $new); echo "filecopy: " . ($res ? "Success!" : "!ERROR: $res"); } } } echo "</li>"; } echo "</ul>"; } echo "</ol></li>"; if($debugIteration) break; } $pages->uncache($p); // just in case we need the memory } echo "</ul>"; exit(); I have tested this with one page and two images, where I have done a little damage too. This was the output:
    1 point
  37. For me, it goes here: // condition <?php if ($config->debug) { ?> // condition as variable <?php $skipMinify = $config->debug || $user->isSuperuser(); if ($skipMinify) { ?> // or, if you have only one occurence in your code where you check this condition, // ommit the temorary variable and write it direct into the condition <?php if ($config->debug || $user->isSuperuser()) { ?> $config->debug is true when developing, and additionally I use superuser condition for later, when in production mode!
    1 point
  38. hi robin, as simple as this: (put it in your /site/ready.php file and adjust to your needs) $this->pages->addHookAfter('added', function($event) { $page = $event->arguments[0]; if($page->template != 'your-template-name') return; $page->setAndSave('title', 'my page - ' . date("YmdHis")); }); set page name format for children to something like Y/m/d H:i:s and set title to locked
    1 point
  39. Just hitted this myself. Should all languages be active from API by default? That would be in line with how it functions in admin.
    1 point
×
×
  • Create New...