-
Posts
132 -
Joined
-
Last visited
Everything posted by nabo
-
The problem is this indeed! The parent page exists! I tried to export the page, copy the json, delete the page and import in the same position. This is the error. Other details PW 3.0.148 superuser
-
Hello I'm trying to use export/import. The export works correctly, but when I try to import data I get this error for each row. 1. Page: /en/data/coupons/coupon_code/ – Fail Unable to locate parent page: /en/data/coupons/ Page cannot be imported I tried every options (changing parent, erasing path info from json)... but nothing. Any idea?
-
Thanks @MoritzLost!!!!
-
Hello is there a way to hook a page save but only when I save it from page edit? And is there a way to prevent page save hook when I trash it? thanks
-
I got a solution (maybe there are others better than mine) public function init() { if($this->wire('user')->isSuperuser()) { $this->wire()->addHookAfter('ProcessPageEdit::buildFormSettings', $this, 'buildForm'); $this->wire()->addHookBefore('Pages::saveReady', $this, 'saveForm'); } } public function buildForm(HookEvent $event) { $p = $event->object->getPage(); $inputfields = $event->return; $data = wire('modules')->getConfig($this); $fieldset = $this->wire('modules')->get("InputfieldFieldset"); $fieldset->attr('id', 'my_fieldset'); $fieldset->label = __("My Renders"); $fieldset->collapsed = Inputfield::collapsedYes; $field = $this->wire('modules')->get("InputfieldTextarea"); $field->attr('name', 'renders'); $field->attr('value', $data['RendersPages'][$p->id]['renders']); $field->label = $this->_('Renders'); $fieldset->append($field); $inputfields->append($fieldset); } public function saveForm($event) { $data = wire('modules')->getConfig($this); $data['RendersPages'][$this->input->post->id]['renders'] = $this->input->post->renders; $this->wire('modules')->saveConfig($this, $data); }
-
Hi class Renders extends WireData implements Module, ConfigurableModule { static public function getModuleInfo() { return array( 'title' => 'title', 'summary' => 'summary', 'version' => '1', 'author' => 'me', 'autoload' => true ); }
-
Hello this is my snippet public function init() { if($this->wire('user')->isSuperuser()) { $this->wire()->addHookAfter('ProcessPageEdit::buildFormSettings', $this, 'buildForm'); $this->wire()->addHookBefore('ProcessPageEdit::processInput', $this, 'saveForm'); } } public function buildForm(HookEvent $event) { $p = $event->object->getPage(); $inputfields = $event->return; $fieldset = $this->wire('modules')->get("InputfieldFieldset"); $fieldset->attr('id', 'my_fieldset'); $fieldset->label = __("My Renders"); $fieldset->collapsed = Inputfield::collapsedYes; $field = $this->wire('modules')->get("InputfieldTextarea"); $field->attr('name', 'renders'); $field->attr('value', $p->renders); $field->label = $this->_('Renders'); $fieldset->append($field); $inputfields->append($fieldset); } public function saveForm($event) { $page = $this->pages->get($this->input->post->id); $page->set('renders', $this->input->post->renders); } It builds correctly the inputs, I edit the field renders but when I save the page the value of this inputfield remain blank. What's wrong?
-
Hi @kongondo any news? I'm just frustrated of working on e-commerce platforms... I need Padloper2 ?
-
Hello @Robin S thank you very much, you save my day! ?
-
Hi @Robin S I updated my ready.php including this wire()->addHookBefore('Page::path', function($event) { $page = $event->object; if($page->id === 1 || $page->template=="_site") return '/'; $path = ''; $parents = $page->parents(); foreach($parents as $parent) if($parent->id > 1 || $parent->template!="_site") $path .= "/{$parent->name}"; $event->return = $path . '/' . $page->name . '/'; }); but nothing different from usual happened... if I tried to log something there's also a Fatal Error
-
Hello I configured the CMS multilanguage with a multisite idea. I created template "_site" and the name of the template is the url of the site interested. This installation is used only as API generator. The problem is that $page->url method returns the url with _site name. Now I have this situation /[language]/[_site name]/example/example... I would like to have this /[language]/example/example.... Is there a way to rewrite this method? The best solution could be a template type check that exclude the _site name in the result. This solution should work also when I select a page in CKEditor to set a link. Thanks
-
Hello I have a repeater that contains two field: a page reference and a textarea. The page reference is a list of user. With superuser all works correctly but with other roles (that have the correct rights to see and edit user as long as pagereference and repeater) there's a small but very annoying problem. I attach some screenshot This is what superadmin see. After the #1: and #2: there's the email of the user page reference. The email field is the field that I choose to set as label field. This is what another role see but... the strange thing is that if I open the row, the pagereference is working correctly so... what's the problem with non superadmin user? Thanks
-
Thanks @bernhard I created the page after the installation of module and it doesn't work. So I uninstall the module and edit it addings permissions and page and now it works as I expected ? thanks again!
-
Hello I created a module to import page and connected the process with a new admin page directly visible in the main menu. I also set the permission to the module 'permission' => 'importposts' and add the permission to a particular role ... but this link doesn't appear when I'm logged in with the role different to superuser. What's wrong?
-
Hello sometimes a page can be very very long. Having the save e publish buttons at the beginning and at the end of the page is great... but maybe it would be better if these buttons will be always visibile at right top of the page after scrolling.
-
Hi is there a way to avoid file extensions check? I would like to upload any kind of files.
-
Hi @Mike Rockett I would like to notice you that the php requirements for this module is incorrect. Since you use 338 public function canBeIncluded(Page $page, ?array $options): bool you need php 7.1 at least
-
Hi @bernhard and thanks. This would work perfectly in a textfield but unfortunately I have these fields inside a Profields: Textareas and Profields: Table. How can I hook them?
-
Hello quite strange request! I've got two fields (inside a Profields: Textarea and Profields: Table) filled with generated URL. I would lock them but would also like to have the link instead of the flat string. Any idea?
-
Hello I have a question: is it possible to set email field as unique value field? It's quite strange to me that this is not a feature... or I missed something? ?
-
Hello I really don't know if it's the right place... I have a CKeditor Textarea and the text inside is like this <p><strong>something></strong> <em>other</em></p> When I render the text in template the space between strong and em is removed... ? OK.....it is caused by HTML minify :(((
-
Hi is it normal that if I add two different roles (that have different restricted branch) to a user, when I log in I can see only one branch?
-
Hello this is my script public function recordUserModifications() { $this->addHookBefore('Users::saveReady', function($event) { $page = $event->arguments('page'); $page->setTrackChanges(Wire::trackChangesValues); $page->setTrackChanges(true); $new_changes = $page->getChanges(true); die(var_dump($new_changes)); }); } and this is the result, when I change name and email array(2) { ["name"]=> array(1) { [0]=> NULL } ["email"]=> array(1) { [0]=> NULL } } I expect an associative array containing an array of previous values, indexed by property name, oldest to newest, but it's NULL. Thanks if you have some suggestions
-
Hello I wrote a module with a hook in page render. The problem is that the hook works also when page are "rendered" in lister. Is it possible to isolate the page render only to the single page view? thanks