-
Posts
5,039 -
Joined
-
Days Won
340
Everything posted by Robin S
-
I might be wrong but I don't think export/import of repeater items is fully supported (seems like repeaters should be excluded from the list of fields available for export to avoid confusion). Just like you can't duplicate a repeater field like you can with most other fields. If you check the export data for a repeater field you can see it is missing a lot of important information like subfields, and things like 'template_id' and 'parent_id' aren't going to be correct on the site you import to. { "test_repeater": { "id": 145, "type": "FieldtypeRepeater", "flags": 0, "name": "test_repeater", "label": "Test repeater", "template_id": 55, "parent_id": 1079, "repeaterFields": "", "repeaterCollapse": 0, "repeaterLoading": 1, "collapsed": 0, "repeaterTitle": "#n: {title}", "repeaterAddLabel": "", "rememberOpen": "", "showIf": "", "columnWidth": 100, "required": "", "requiredIf": "" } }
-
Could you please describe where the problem was and how you resolved it, in case people have similar problems in the future? Thanks.
-
Not sure I can be much help, but can you describe the setup in some more detail? These subdomains: does each subdomain have an independent installation of PW? Or a multi-site setup? In which case what 'flavour' of multi-site? (e.g. one of the kinds described in the docs, PW3 multi-instance, or Soma's module) And the objective is to have a kind of single sign-in that works across the sites/subdomains? Or do you just have a single-site PW installation that you can access from more than one subdomain?
-
This sounds to me like it's a permissions/access issue - so not so much about which browser but about the fact that you were probably logged in as superuser when you were first viewing the website, but you're a 'guest' when viewing in those other circumstances. Have you done anything out-of-the-ordinary around access, e.g. removed guest view permission for a template or a field? It looks like you have a single page frontend where you pull sections of content from child pages. Did you maybe do something to try and prevent direct access to those child pages? Just trying to work out why guest access would be limited somehow.
-
Multisites with same templates and different databases
Robin S replied to shivrajsa's topic in General Support
Welcome @shivrajsa, The simplest way would be for the template files in each /site/templates/ directory to consist only of include() statements, which draw from a central templates directory at /templates/. Ryan suggests something like this here: Or, as also mentioned in that thread, you could consider using symlinks. -
Where have page tree bookmarks and page edit bookmarks gone?
Robin S replied to Robin S's topic in General Support
Thanks @abdus, that works for the Page Edit bookmarks. But the Page Tree bookmarks are still MIA, maybe because the "Tree" menu item has recently been repurposed for the tree dropdown menus? -
Back when PW 2.6.17 was released the blog post that week described several types of bookmarks: https://processwire.com/blog/posts/processwire-2.6.17-expands-admin-navigation-with-bookmarks/ In recent versions of PW3 I can't find where Page Tree bookmarks and Page Edit bookmarks may be defined or accessed. Have these two bookmark features been removed?
-
That syntax is not quite right. The format is this: elements [attributes]{styles}(classes) So your rule would be: a[href,rel](*) Don't think you need to include the href attribute though as that is allowed by default.
-
Dynamic page links based on page's id instead of URL
Robin S replied to woop's topic in Wishlist & Roadmap
@BillH, PW now takes care of link abstraction inside CKEditor fields if the "Link abstraction" setting is checked for the field (which it is by default). There is also the Page Path History module which will take care of redirects when a page path changes (this works for all pages, not just links inside a CKEditor field). -
[Solved] Permission problem – no access to /site/assets/
Robin S replied to rash's topic in Getting Started
Your permission issues may be affecting all PW files. This error... Compile Error: require_once(): Failed opening required '~/site/modules/TextformatterTextile/src/Parser.php' (include_path='~/wire/modules/Markup/MarkupHTMLPurifier/htmlpurifier/standalone:.:/usr/share/php:..') (line 39 of ~/site/modules/TextformatterTextile/TextformatterTextileField.module) ...relates to a file outside /site/assets/. So when you are testing the change of owner you should do this for all PW files. -
@LMD, thanks for the report. Please update to v.0.04 where this issue should be fixed.
-
If people come up with any nifty usages of HannaCodeDialog it would be cool to get a bit of a library going in this thread. Here's one to get the ball rolling. Select FormBuilder form For the foolproof selecting of a FormBuilder form to embed in a CKEditor field. Import both of the export strings to use this. The code is shown here just for reference. _formbuilder_forms Export string (import this into Hanna Code): !HannaCode:_formbuilder_forms:eyJuYW1lIjoiX2Zvcm1idWlsZGVyX2Zvcm1zIiwidHlwZSI6IjIiLCJjb2RlIjoiPD9waHBcbmVjaG8gaW1wbG9kZSgnfCcsIGl0ZXJhdG9yX3RvX2FycmF5KCRmb3Jtcy0+Z2V0SXRlcmF0b3IoKSkpOyJ9/!HannaCode Code (just for reference): <?php echo implode('|', iterator_to_array($forms->getIterator())); select_form Export string (import this into Hanna Code): !HannaCode:select_form:eyJuYW1lIjoic2VsZWN0X2Zvcm0iLCJ0eXBlIjoiMiIsImNvZGUiOiJcLypoY19hdHRyXG5mb3JtPVwiXCJcbmZvcm1fX29wdGlvbnM9XCJbW19mb3JtYnVpbGRlcl9mb3Jtc11dXCJcbmhjX2F0dHIqXC9cbjw/cGhwXG5pZigkZm9ybSkgZWNobyBcIjxwPmZvcm0tYnVpbGRlclwvJGZvcm08XC9wPlwiOyJ9/!HannaCode Code (just for reference): <?php if($form) echo "<p>form-builder/$form</p>";
-
Did you clear the ProCache document cache? Still seeing the missing content issue in "Book recommendations" and the malformed Goodreads link. Column layout is fixed though.
-
I am referring to the Books parent page: https://ricardo-vargas.com/books/ Edit: we posted simultaneously
-
What's up is that the size() method accepts a 'quality' setting in its $options array: https://processwire.com/api/ref/pageimage/size/ And you can define the default quality setting used for the image sizer in /site/config.php via $config->imageSizerOptions: https://processwire.com/api/ref/config/
-
I tested in Firefox and Chrome on Windows. But I would expect the same for all browsers because the issues are in the source code. Odd that you don't see them at your end - maybe I'm seeing cached content and you're not. 1. "Book recommendations" item missing expected content - probably just needs some if() conditions. 2. Side column: you have a mismatch between large/medium column classes, meaning the side column wraps under the main column but remains narrow at medium device width. 3. Goodreads link
-
FYI: I just checked the LoginPersist module and it's working for me in PW3.
-
Nice work! Must be a good feeling to have such a big task completed and live. I'm always interested to hear how much time goes into larger jobs like this undertaken by a single developer: any idea how long you spent on it? I noticed a couple of minor display issues on the Books page. You can see both in the screenshot below: "Book recommendations" item seems to be missing expected content. Side column layout issue at some device widths. Edit: one more on this page... the "Powered by Goodreads" link is malformed. Again, a really great site.
-
Not in this fieldtype as it stands because it only has a single inputfield. But you can create other fields for the purpose and add them to your template, maybe grouped inside a fieldset together with the Assisted URL field. Text fields for title and rel, and maybe a Select Options field would be good for target.
-
@tpr, another idea/request: if the "permanent delete" option for Page List is checked then there is also an option to permanently delete the page from the Delete tab of Page Edit. Thanks!
-
It requires a couple of steps, but so long as your pages selector doesn't return a huge number of results this should be fairly low impact: $value = 'Foo'; $all_matches = $pages->find("my_table.my_field=$value"); $first_row_matches = $pages->newPageArray(); foreach($all_matches as $match) { if($match->my_table->first()->my_field == $value) $first_row_matches->add($match); }
-
AddHookAfter("save"...) on Page template ==("")
Robin S replied to Mathroth's topic in Module/Plugin Development
Needs the Pages class in there somewhere. Either: public function ready() { if($this->page->template->name == 'TemplateName') { $this->pages->addHookAfter('save', $this, 'syncMobileDE'); } } Or: public function ready() { if($this->page->template->name == 'TemplateName') { $this->addHookAfter('Pages::save', $this, 'syncMobileDE'); } } -
Try Pageimages::add($item)... $user->userimage->add($upload_path . $files[0]);
-
@tpr, I often want to work with system templates. Examples being: Add fields to the user template, and want easy access to the template from the admin menus or without having to set the "Show system templates" filter in the templates list. When editing a field, add that field to the template of a repeater field. Normally to do stuff like this you have to have $config->advanced = true in /site/config.php, but I don't want the risk of messing up the other things that this setting exposes. So I looked at making system templates visible through hooks and came up with this: // Show system templates $this->addHookBefore('ProcessField::buildEditFormInfo', function($event) { // Show system templates in templates list of Edit Field $this->wire('config')->advanced = true; }); $this->addHookBefore('ProcessTemplate::executeNavJSON', function($event) { // Show system templates in admin menu $this->wire('config')->advanced = true; }); $this->addHookAfter('Session::loginSuccess(roles=superuser)', null, function($event) { // Show system templates in templates list unless explicitly hidden $this->wire('session')->set('ProcessTemplateFilterSystem', 1); }); Is this something you think would be a good option to add to AOS?
-
Loading field options into inputfieldSelect
Robin S replied to Marcel Stäheli's topic in API & Templates
To add the 'country' field you can simply do this: $inputfield = $user->getInputfields('country'); $form->add($inputfield); Depending on how many fields in your user template, when building a profile edit form for the frontend it can be easier to define an array of 'ignore' fields and then add all inputfields for the user template that are not in the ignore array. Pretty sure I got this idea from some code by @Soma. // Get the fields from the user template $inputfields = $user->getInputfields(); // Don't include these fields in the form $ignore_fields = [ 'user_name', 'temp_password', 'roles,' ]; // Add the inputfields to the form foreach($inputfields as $inputfield) { if(in_array($inputfield->name, $ignore_fields)) continue; $form->add($inputfield); }