Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/06/2018 in all areas

  1. Minimal Fieldset Adds a config option to Fieldset/FieldsetGroup/FieldsetPage to render the fieldset without label or padding in Page Edit. When a neighbouring field in the same row is taller than the fieldset the extra height is distributed evenly among rows within the fieldset. Requires ProcessWire v3 and AdminThemeUikit. Why? This module allows you to create layouts in Page Edit that would not be possible without it. It's useful when you want a layout that has two or more fields as rows that are themselves within a row in Page Edit. It's also useful when you have some fields that you want to add to a template as a group (i.e. via FieldsetGroup or FieldsetPage) but having a heading and visible wrapper for the fieldset in Page Edit would be redundant. Example: Installation Install the Minimal Fieldset module. Usage In the field settings for any Fieldset/FieldsetGroup/FieldsetPage, tick the "Remove label and padding for this fieldset" checkbox. https://github.com/Toutouwai/MinimalFieldset https://modules.processwire.com/modules/minimal-fieldset/
    9 points
  2. This has got to be the craziest website I have ever seen: http://zoomquilt2.com/ http://zoomquilt.org/ It's like infinite zooming. Contains some questionable content, may be NSFW.
    2 points
  3. AFAIK you cannot do it out of the box but with the AdminOnSteroids module it is possible, see Allow markup tokens for "List of fields to display" here: https://github.com/rolandtoth/AdminOnSteroids/wiki/PageListTweaks ({date_created}|date:%Y/%m/%d)
    2 points
  4. Just found nolt.io by coincidence and tried it out... It's really simple to setup a Roadmap with voting functionality: https://53261ae5.nolt.io/ What do you think? Could that be useful?
    2 points
  5. Everybody can make music. ? https://audiotool.com is a powerful pretty unique in the browser sound production studio. I remember back then it was made with flash, nowadays it's a JS app with 600k lines of code. Pretty amazing if you never seen it try it out.
    1 point
  6. Thx! Our IT and Web-Dev Department is located in Graz - so greeting to vienna ?
    1 point
  7. If that's your concern you could always use $page->getUnformatted('datefield') in your templates and use the outputformatting just for the backend formatting.
    1 point
  8. 1 point
  9. My guess is that some non-printable character got pasted inside your code. See the comments in this thread from here down: If that's not it then you can also use Tracy Debugger to debug why $template is undefined for you. All that the relevant code inside the hook is doing is looping over the $templates API variable with $template representing each Template object, so I can't see where else that could be going wrong.
    1 point
  10. @szabesz I tested @BitPoet solution and it works well. Thanks BitPoet for the work around but hope that @ryan will make this change to the core. Gideon
    1 point
  11. @horst Thank you for that code. I was able to ensure that the language was being delivered properly. It turns out that the tech managing our in-house web server had very very aggressive caching enabled through Nginx and purging the entire site's cache fixed the issue. The issues that were coming up didn't look like a caching issue so it was odd. Had odd URL issues and redirect looping. General recommendation to everyone is check with your server admin when all hope is lost...
    1 point
  12. The problem is that anything that looks like a ctype_digit is coerced to int in Selectors::makeSelectorArrayItem, even if you use nested array syntax and pass in the name of a sanitizer method.
    1 point
  13. Yes, we should have one hopefully this month.
    1 point
  14. There has been no change here, the WireArray::new() method remains as it was before. It was only the non-static implementation that was removed, which was present not for functional reasons, but purely so that it would show up in the auto-generated API docs to represent the static version. That non-static version was causing issues in PHP versions prior to 7.x. The static version does not cause issues because it's implemented via PHP's __callStatic() handler. While there are WireArray() and PageArray() functions that can be used the the same way as WireArray::new() and PageArray::new(), the ::new() versions are preferable because they will work with any WireArray derived type, and as a bonus, they can also accept variable argument lists.
    1 point
  15. I've added a few details about the cause of the expection to the issue. In short, the pages.name table is created with an ascii charset by the installer, which should probably be changed. As a workaround, after installation, execute the following statement: ALTER TABLE pages MODIFY COLUMN `name` varchar(128) character set utf8 NOT NULL; (Change utf8 to utf8mb4 if you selected that character set in the installer)
    1 point
  16. There are different inputfields in ProcessPageEditLink and they need to be treated differently: Link to URL, Select Page, Select Child Page. For Link to URL I agree that there is probably no common use case that needs pages without template files to be visible/selectable here. For Select Page and Select Child Page, I think that pages without template files should appear there because those pages may have viewable child pages, and also I think it is easier for users to understand these inputfields if they show the same pages that they are familiar with from ProcessPageList where non-viewable pages are listed. But the pages without template files should not be selectable as links. I suggest you raise a GitHub request or issue to ask for a change to this. In the meantime here are a couple of workaround hooks for /site/ready.php: // ProcessPageEditLink > Link to URL: exclude pages using templates without template file $wire->addHookBefore('InputfieldPageAutocomplete(name=link_page_url)::render', function(HookEvent $event) { $inputfield = $event->object; $fileless_templates = []; foreach($this->wire()->templates as $template) { if(!$template->filenameExists()) $fileless_templates[] = $template->id; } $inputfield->findPagesSelector .= ', template!=' . implode('|', $fileless_templates); }); // ProcessPageEditLink > Select Page / Select Child Page: prevent selection of pages using templates without template file $wire->addHookAfter('ProcessPageEditLink::execute', function(HookEvent $event) { $css = ''; foreach($this->wire()->templates as $template) { if(!$template->filenameExists()) $css .= ".PageListTemplate_{$template->name} .PageListActionSelect, "; } if($css) { $css = rtrim($css, ', '); $css .= ' { display:none !important; }'; $event->return .= "<style>$css</style>"; } });
    1 point
  17. Since every hosting company can basically configure their servers as they wish, it would be wise to ask them directly. On some hosting environments, you can add PHP/Apache customization via control panel, on others you have to add a user.ini file in your site's root directory. With others you have to use .htaccess. But which methods are allowed or not, can surely be answered by their tech support team.
    1 point
  18. I wasn't clear. I meant customer addresses, emails etc should not be editable in the order. However, I now see your point about the need to edit an address, e.g. a customer entered the wrong details and phoned in to amend. If I get you correctly, as for order states, yes, we have that. I posted a few details in this post. Yes, manual order creation is already available. The API is finished. I'll post details soon, hopefully by tomorrow. I just need to finish testing a few other things first. So, manual order creation will be possible for whoever you want. You can take orders over the phone, at the POS, accept cash payments, invoices for goods delivered, etc. The interface is not ready but the API is. This means you can even use the API directly to create orders, not that you would want to do that if you have a GUI ?
    1 point
  19. Won't find the time to implement this anytime soon, sorry. Everybody feel free to submit a PR regarding this and maybe ping core contributor @justb3a regarding release
    1 point
  20. I think that button is added through javascript so you might as well just add it in a script that runs in the admin, like this: http://soma.urlich.ch/posts/custom-js-in-processwire-admin/
    1 point
  21. Not a direct answer to your question, but did you consider building a dashboard? i.e. a special page where you would have useful shortcuts for your admins, like "add news item", "add new event" etc. There are quite a few helpful forum threads with various suggestions how to build something like that.
    1 point
  22. A hook for anyone still wanting a solution for this: // Prevent the trashing of pages referenced by other pages $pages->addHookBefore('trash', function(HookEvent $event) { $page = $event->arguments(0); // Find non-system Page Reference fields $pr_fields = $this->fields->find("type=FieldtypePage, flags=0"); // Implode for selector string $pr_fields_str = $pr_fields->implode('|', 'name'); // Find any referencing pages $referenced_on = $this->pages->find("$pr_fields_str=$page->id, include=all"); if($referenced_on->count) { // Replace the trash method $event->replace = true; // Link markup for referencing pages $referenced_on_str = $referenced_on->implode(', ', "<a href='{editUrl}'>{name}</a>"); $plural = $referenced_on->count > 1 ? 's' : ''; // Trigger an error message (using $session in case a superuser is trashing from ProcessPageList) $this->session->error("You cannot trash page $page->name because it is referenced in a Page Reference field on page$plural $referenced_on_str.", Notice::allowMarkup); // Don't allow the trashing of this page $event->return = false; } }); When attempting to trash a referenced page from ProcessPageList the page will at first appear to be trashed but in fact it is not, and on the next admin page load a notice will be displayed explaining the situation. I don't think this detail matters much because it only affects superusers.
    1 point
  23. Nice site. He has other interesting articles on this site: http://www.davidkissinger.com/spin-up-a-quick-installation-of-processwire-with-docker-compose/
    1 point
  24. New ways to look at content management: ProcessWire http://www.davidkissinger.com/processwire/
    1 point
  25. The inputfield value is not saved correctly because config you are trying creates an error: PHP Notice: Object of class ProcessWire\Page could not be converted to int in ...\modules\Process\ProcessModule\ProcessModule.module:1287 So it seems that the inputfield you have created is returning a page object when what is expected is a page id. One solution is to create the options you want to make available in the inputfield: class ProcessHelloConfig extends ModuleConfig { public function __construct() { $items = $this->pages->find("parent=1"); $page_options = []; foreach($items as $item) { $page_options[$item->id] = $item->title; } $this->add(array( // Text field: greeting array( 'name' => 'greeting', // name of field 'type' => 'text', // type of field (any Inputfield module name) 'label' => $this->_('Hello Greeting'), // field label 'description' => $this->_('What would you like to say to people using this module?'), 'required' => true, 'value' => $this->_('A very happy hello world to you.'), // default value ), // Radio buttons: greetingType array( 'name' => 'greetingType', 'type' => 'radios', 'label' => $this->_('Greeting Type'), 'options' => array( // options array of value => label 'message' => $this->_('Message'), 'warning' => $this->_('Warning'), 'error' => $this->_('Error'), ), 'value' => 'warning', // default value 'optionColumns' => 1, // make options display on one line 'notes' => $this->_('Choose wisely'), // like description but appears under field ), // My custom test field array( 'name' => 'myTest', 'type' => 'select', 'label' => $this->_('Test'), 'options' => $page_options, ), )); } } BTW, if you want to allow the user to select any page from the tree you can use the Page List Select inputfield: // My custom test field array( 'name' => 'myTest', 'type' => 'PageListSelect', 'label' => $this->_('Test') )
    1 point
  26. Here's a script that I've been using on our sites and recently enhanced to also handle the conversion from TinyMCE to CKEditor in ProcessWire 2.5. It's a sort of "global config" for CKEditor, which allows you to change the settings for all CKEditor fields at once. Note: This one will automatically update all CKEditor fields unless they are explicitly excluded in the config ($excludedFields). If you want it to change TinyMCE fields into CKEditor fields, make sure $replaceTinyMCE is set to true in the config section of the code. <?php include('./index.php'); // Config $excludedFields = ""; // List of fields to exclude, separated by pipe (i.e. "body|sidebar") $replaceTinyMCE = false; // true|false If true, converts any fields using TinyMCE to use CKEditor instead // Change any fields using TinyMCE to use CKEditor instead if($replaceTinyMCE) { foreach(wire("fields") as $field) { if($field->type == 'FieldtypeTextarea' && $field->inputfieldClass == 'InputfieldTinyMCE') { $field->inputfieldClass = 'InputfieldCKEditor'; $field->save(); } } } // Get all fields using CKEditor $fields = new WireArray(); foreach(wire("fields") as $field) { if($field->type == 'FieldtypeTextarea' && $field->inputfieldClass == 'InputfieldCKEditor') { $fields->append($field); } } // Exclude any fields specified above $fields = $fields->find("name!=$excludedFields"); // Apply settings foreach($fields as $field) { $field->contentType = "1"; // 0="Unknown", 1="Markup/HTML" $field->rows = "15"; // The number of rows initially shown for this field. $field->toolbar = " Styles Undo, Redo Bold, Italic, -, RemoveFormat NumberedList, BulletedList, -, Blockquote PWLink, Unlink, Anchor PWImage, Table, HorizontalRule, SpecialChar PasteText, PasteFromWord Scayt, -, Sourcedialog "; $field->inlineMode = "0"; // 0="Regular Editor", 1="Inline Editor" $field->textformatters = array("TextformatterHannaCode","TextformatterVideoEmbed","TextformatterSmartypants"); // Accepts ordered array of module names $field->useACF = "1"; // 0="No", 1="Yes" $field->usePurifier = "1"; // 0="No", 1="Yes" $field->extraAllowedContent = ""; $field->formatTags = "p;h2;h3;h4;h5;h6"; $field->contentsCss = ""; // Path to your css file, i.e. "/site/templates/styles/contents.css" $field->stylesSet = ""; // Path to js file containing stylesSet, i.e. "mystyles:/site/modules/InputfieldCKEditor/mystyles.js" $field->customOptions = ""; // Custom Config Options $field->extraPlugins = "pwimage,pwlink,sourcedialog"; $field->plugin_sourcedialog = ""; // Sourcedialog settings $field->removePlugins = "image"; $field->save(); } ?> CKEditor is now updated. Updated fields: <? foreach($fields as $field) echo $field.', ' ?> To use the script, simply copy the above code into a file in the root directory of your ProcessWire installation, and name it something like "ckupdater.php". Edit the configuration settings under the "Apply settings" section how you'd like, (I've done my best to briefly document how these work--at least the more confusing ones). To run the updater, just go to www.yoursitegoeshere.com/ckupdater.php. It will confirm the update and tell you which fields were effected. Hope this helps someone out!
    1 point
  27. ProcessWire won't do a partial match for multiple words with a single operator, i.e "Mike Hunt" matching "Michael Hunter". However, this is easy to solve: $pages->find("keywords*=Mike, keywords*=Hunt"); This is how you might handle it from a submitted search query: <?php $selector = ''; $words = explode(' ', $this->input->get->phrase); foreach($words as $word) { $word = $this->sanitizer->selectorValue($word); if($word) $selector .= "keywords*=$word, "; } $pages->find($selector); This is correct. If the term "notfall" is present in the search but not in any of the pages, it's not going to match any pages. The %= performs the same phrase match as *= except that it uses a non-indexed MySQL 'LIKE' search, which is slower but can match stopwords and words shorter than what MySQL will fulltext index. Like with *=, if you wanted it to match parts of multiple words then you'd have to split it like in the example above. Either of these will work: $pages->find("keywords*=zeit, keywords*=bern"); $pages->find("keywords%=zeit, keywords%=bern");
    1 point
  28. Was just about to write a foreach loop when I've seen your response. Ahh sure, forgot almost there's no need for loops here! Thanks a lot Ryan for giving the most amazing code example on planet earth. Love it!!! I don't know of any other system that would do this with just two short lines! Perfect.
    1 point
  29. You are right about how to do it. This is all it should take: <?php $contacts = $pages->find("body*='search term', template=emergency-contact"); $parents = $pages->find("emergency-contacts=$contacts"); emergency-contact = your template name (optional) emergency-contacts = your page reference field name $parents will have all the pages that had one of the emergency contacts selected with the given search term.
    1 point
×
×
  • Create New...