Jump to content

torf

Members
  • Posts

    64
  • Joined

  • Last visited

Everything posted by torf

  1. That's a very handy module. Thanks a lot. Where I got a bit into trouble is adding multiple classes to a table, as it keeps replacing every space with an "-" and makes it therefore impossible to add multiple classes (like for instance "table table-striped" gets saved as "table-table-striped". I suppose that's the sanitizer function. Have you got any idea for a workaround?
  2. I already thought of purchasing Profields, but as far as I understood profields-table creates a specific DB-Table for every table. That would create about 20-50 tables in my database, each for just a couple of data rows. Thats the sort of overhead I'm trying to avoid.
  3. I have a couple of pages - all with the same template - and each page needs a couple of small tables for additional data. All of them with totally different rows and columns. I looked into Matrix Fileds, which is a wonderful Module, but as I need about 10 or more different tables that would need dozens of pages to set up rows an columns. Same goes for repeater fields, as I'd need a repeater for every kind of table. Of course the easiest way would be to set up those tables in CKeditor, and just display them, but the table interface in CKeditor is quite messy and I fear the later editors of the site will mess them up in no time. Can anyone think of an easy way to set up tabular data which is displayed as tabular data in the backend, without preparing dozens of fields or pages?
  4. Thanks @teppo!! Sometimes taking a second look helps. The Domain "view" is pointing to has a "www", while the backend I used has not. Now I know where I need to make adjustments.
  5. I have a strange issue when previewing unpublished pages, and need some advice how processwire is supposed to work: When I add a new page in my tree a logged in user can preview the page even when it is unpublished via the view button. On my production site this is no problem and would of course be the desired behaviour. But on my live site clicking on "view" ends in a 404 every time as long as the page is unpublished. That even happens when I'm logged in as superuser. What is the "normal" behaviour" and does anyone know what could cause that effect?
  6. If anyone stumbles over that again - deleting $this->message($event); did the trick. Now it works.
  7. Sorry, I've been offline shortly. Mostly the Error occurs in wire/core/sanitizer.php on line 2555: public function entities($str, $flags = ENT_QUOTES, $encoding = 'UTF-8', $doubleEncode = true) { if(!is_string($str)) $str = $this->string($str); return htmlentities($str, $flags, $encoding, $doubleEncode); //<-- Thats line 2555 } sometimes in wire/core/Notices.php Line 523 protected function formatNotice(Notice $item) { $text = $item->text; if(is_array($text)) { $item->text = "<pre>" . trim(print_r($this->sanitizeArray($text), true)) . "</pre>"; $item->flags = $item->flags | Notice::allowMarkup; } else if(is_object($text) && $text instanceof Wire) { $item->text = "<pre>" . $this->wire()->sanitizer->entities(print_r($text, true)) . "</pre>"; //<-- Line 523 $item->flags = $item->flags | Notice::allowMarkup; } else if(is_object($text)) { $item->text = (string) $text; } if($item->hasFlag('allowMarkdown')) { $item->text = $this->wire()->sanitizer->entitiesMarkdown($text, array('allowBrackets' => true)); $item->addFlag('allowMarkup'); $item->removeFlag('allowMarkdown'); } }
  8. I stumble upon a strange problem regarding images in rich text fields. For a section I use CKEditor for the Content. Additionally there is a imagefield for each page where inline images for this article can be uploaded. then the editor can take those images and embed them in CKEditor. In the Frontend the images are shown inline with a additional lightbox which is preformatted via ready.php: $wire->addHookAfter('TextformatterProcessImages::processImg', function(HookEvent $event) { $this->message($event); $pageimage = $event->arguments(1); $img = $event->arguments(0); if($pageimage) { $img->outertext = "<figure class='figure'><a data-fancybox='gallery' data-caption='{$pageimage->description}' class='lightboxclass' href='{$pageimage->url}'><img src='{$pageimage->size(600,0)->url}' class='figure-img img-fluid rounded' alt='{$pageimage->description}'/></a><figcaption class='figure-caption text-end'>{$pageimage->description}</figcaption></figure>"; } }); There is no Problem embedding and saving those images, but the moment a new article is published, and it has more than one image inline, the frontend gives me an "out of memory" php-error. PHP memory is set to 512MB which I think should be enough. Has anybody an idea if there is a problem that creates a loop in my script, or is it just not enough memory? Thanks for any help. PS: the problem occurs regardless of image size. If I take 12KB images or 12MB. It's always the same.
  9. Thanks, but what permission is it? If I knew I could just give this permission to my userrole, but only superuser seems to get the "choose parent" page. And I cannot give superuser rights to my users.
  10. I have a strange behaviour that I cannot fully understand. In my page there are child pages who themselves have subpages. Home Child 1 Child 2 Sub 2.1 Child 3 Sub 3.1 Sub 3.2 A couple of my roles have the right to add new subpages to any of the childpages. Works great if I use the treen navigation and "new" beside one Child. But if I use the "add new" button on the right, or the "add new" link from dropdown in the header, only the superuser is shown a page to choose the parent before adding the subpage. For any other user it directly creates a subpage in one of the children. Does anyone know which right is needed to get the selector for other roles than superuser?
  11. Thanks for this wonderful and extremely helpful module, but I was wondering if there is a possibility to assign more than one role to a user with this module? I have 4 roles with basically the same rights but access to different branches of my site (access is granted by role). Now if I give a user more than one of this roles Admin Restrict Branch gives them access to only the first branch but not the other ones. I'm aware that it is not possible to have multiple branches in one role, but is it somehow possible to mix branches with multiple roles for one user?
  12. Thanks. Yes I've read this one and I already use it. But the SU has the right to empty the Trash completely, while any non superuser has to go the whole way edit->delete->confirm for every single page in trash. What I try to achieve is making this button available for users below superuser.
  13. Maybe I'm missing a point here, but I could not get my users to empty the trash. In my site I've got a Couple of user roles with limited rights for different parts of my page. Above them all there is one role with access to the whole page, users and form entries but not superuser (due to the nature of my clients I do not want them to fiddle around with forms or modules). So some users have the right to delete pages, but cannot access the trash, while the "master role" is supposed to empty it from time to time. What rights do I need for this role to empty the trash without opening every page manually? Or is the "empty trash" button strictly for superusers?
  14. I have a page that has frontend and backend users. So frontend users register themself via the old Login/Register module and get assigned a special guest role, while backend users are made by the site-admin in backend. My problem is that frontend users have a lot of required fields (from name, phone number and address up to specific company information), while backend only need login, email, password and their role. If I mark all those extra fields as required, the site admin would have to fill them out in the backend as well when adding a new user. Is there any hook for adding the required status of those extra fields only in the frontend? Or seperate frontend and backend users in another way?
  15. I was trying to set up a workflow so a specific role receives an email when another role marks a page as "ready for publishing" via checkbox. Seems like this module does exactly that, but it's listed as not compatible with PW3.0. Has anybody tried it already or knows if it works?
  16. Thanks a lot - both of you. It works, and again I am a bit nearer to understanding how processwire works.
  17. Hi, I really got Stuck on a quite common Task, but cannot find the problem. The Idea was to have a checkbox in my backend, and set another integer field to 0 upon save if this checkbox is not checked. So I added the following code to my ready.php $wire->addHookBefore('Pages::saved', function($event){ $page = $event->arguments(0); if($page->hasField("my_checkbox")) { if($page->my_checkbox == 0) { $page->another_integer_field = 0; $this->message("This should have worked"); //for debugging only } } }); Everything works great, the debugging message shows up, but the value in "another__integer_field" does not change. Can anybody tell me where my mistake is?
  18. I see. Thanks for the clarification @Robin S I use a German backend translation and it seems the filter for showing only valid options does not show up in German... Sadly the selector is a bit more complicated in reality. Pages are chosen based on a value in another page selector field they hold. So the original selection is $wire->addHookAfter('InputfieldPage::getSelectablePages', function($event) { if($event->object->hasField == "choose_page") { $page = $event->arguments(0); $zv = $page->parent->title; $event->return = $event->pages->find("template=my_Template, field_in_my_Template=$zv"); } }); I do not think that can be achieved without php.
  19. Oh. I didn't know this one. I just tried $wire->addHookAfter('InputfieldPageAutocomple::findPagesSelector', function($event) { if($event->object->hasField == "choose_page") { $event->return = $event->pages->find("template=template_name_to_choose_from"); } }); but to no avail. I still get every page returned. Or maybe I have misunderstood how to use it. What puzzles me is that it works perfectly with Dropdwon or Select. How is Autocomplete different?
  20. Hi everybody, I tried to make only special pages accessible through a page reference field, but got a strange problem. In my ready.php I added $wire->addHookAfter('InputfieldPage::getSelectablePages', function($event) { if($event->object->hasField == "choose_page") { $event->return = $event->pages->find("template=template_name_to_choose_from"); } }); But I keep getting all pages of my site back when I use autocomplete for my field. With select or radio it works as expected. Can anybody tell me why?
  21. basename($child->template->filename) does the job of course, thanks. But I still do not understand how the function in Processwire is used. The reference is not very clear.
  22. For onpager navigation I'm trying to get the name of all template php files so I can include them based on their status (hidden/shown). But I cannot get the names without the path. So foreach($page->children() as $child) { echo $child->template->filename()."<br/>"; } gives me the whole path for each file. In https://processwire.com/api/ref/template/filename/# it is stated, that the argument $filename can omit the path, but without examples I'm to dumb to find out how to use it... PS: of course I could strip it with vanilla php, but if there is already a function for that I'd rather use it.
  23. Is there any workaround by now? I need to have my backend set to German as default (as the person using the page does not speak English), and cannot get the datefield to save a date.
  24. I also confirm what digitex said: There is no header dropdown, and the map container shows nothing. Looks to me as JS execution is stopped because of the following error: Uncaught Error: Invalid LatLng object: (NaN, NaN) LatLng https://unpkg.com/leaflet@0.7.7/dist/leaflet.js:6 latLng https://unpkg.com/leaflet@0.7.7/dist/leaflet.js:6 setView https://unpkg.com/leaflet@0.7.7/dist/leaflet.js:9 init https://www.xxxxx.at/site/modules/FieldtypeLeafletMapMarker/InputfieldLeafletMapMarker.js?v=3.0.3-1643876775:23 <anonymous> https://www.xxxxx.at/site/modules/FieldtypeLeafletMapMarker/InputfieldLeafletMapMarker.js?v=3.0.3-1643876775:179 jQuery 2 each each <anonymous> https://www.xxxxx.at/site/modules/FieldtypeLeafletMapMarker/InputfieldLeafletMapMarker.js?v=3.0.3-1643876775:177 jQuery 11 l fireWith ready A promise ready init v support <anonymous> <anonymous> leaflet.js:6:13622 Using ProcessWire 3.0.184 ---- Maybe to be more specific: the module works like a charm, but in the backend it shows up without initial marker, and therefore no map is rendered. As soon as you type in any lat / lon the map shows up and you can place the marker accordingly.
  25. I really do like the plugin, but I could not figure out how the resizing in "Petersburger Hängung" works. Either it is buggy, or I am dumb. If I upload images to my site and have the preview images in the plugin set to size=500x500 upscaling=false cropping=false I get neat little images of different widths (like my originals are). But the moment I use cropping, or setting a focus point on one of the images the plugin shows this image in a brutal fixed size of 500x500. (funny thing is: resizing does not change the image aspect ratio and works as expected) Does anybody know how I can use at least the cropping of ProcessWire without destroying the gallery layout?
×
×
  • Create New...