Jump to content

Robin S

Members
  • Posts

    5,009
  • Joined

  • Days Won

    333

Everything posted by Robin S

  1. Hi and welcome @ren! I recommend you install the Tracy Debugger module as you'll find this an essential tool when developing. Then you can dump the $page object above your if() conditional and explore what its properties are (parent, url, etc). It should be obvious then why $page will or will not match those conditions you have set. // do not redirect if page matches: bd($this->page, 'page'); if($this->page->template != "admin" // any non-admin page || $this->page->is($this->redirectPage) // the dashboard page (prevent infinite loop) || $this->page->parent->is('/admin/login/') // various attempts to allow logging out || $this->wire("process") == 'ProcessLogin' || strpos($this->page->url, $this->wire('config')->urls->admin . 'login/logout') !== false ) { return; }
  2. When looping over the pages in a Page field, set some property to the Page object to serve as an indicator that the page has been processed. Then put your code that processes the pages inside an if() condition that checks that the property has not already been set. So something like: if(!$page->processed) { // do your processing here // ... $page->processed = true; }
  3. I did a bit of testing today with $config->sessionCookieDomain and I couldn't get it to log me in across subdomains. Also, if I logged in on one subdomain and then tried to log in on the other subdomain I was sent in a endless redirection loop.
  4. Hi @tpr, could you please add a "word-wrap: break-word" rule for the filename link when the 'no-truncate' option is on for File fields? See the screenshot below where filenames with underscore word separators do not wrap. Thanks.
  5. This config setting sounds like it should do what you're aiming for... $config->sessionCookieDomain null or string Domain to use for sessions, which enables a session to work across subdomains, or NULL to disable (default/recommended). ...but I see you have already tried that. Maybe try without the leading dot? If that setting still doesn't work I suggest opening a GitHub issue so Ryan can confirm if it's a bug or not. Sorry to hear this is proving so difficult to get working. If you want to investigate some more yourself you could install the essential Tracy Debugger and start dumping stuff inside /wire/core/Session.php to try and find out where the issue is occurring.
  6. I think most people do, but you don't have to. You can do this using includes. For instance, you could have a template file "master.php", and set this file as the "Alternate template filename" for all your templates. Then in the master file you use some logic to include the file that contains the code for each template. For instance, you could create some subfolders to divide up these included files and then tag templates (on the Advanced tab of Edit Template) with a single tag according to which subfolder their file is in. Your logic in master.php then could be something like this: $path = $page->template->name . '.php'; if($page->template->tags) $path = $page->template->tags . '/' . $path; include($path);
  7. @PWaddict, if you want to hide just the Tree menu I made a module for that: AdminOnSteroids adds some classes to the body element that can help with this: https://github.com/rolandtoth/AdminOnSteroids/wiki#extra-classes-added-to-body-tag So you can prefix your CSS rule with body.role-nonsuperuser
  8. Note: this functionality is now built into AdminOnSteroids. I wanted to hide the Tree dropdown menu for some roles, so I made this simple module. https://github.com/Toutouwai/RestrictTreeDropdown RestrictTreeDropdown Allows the Tree dropdown menu to be hidden for selected roles. Usage Install the RestrictTreeDropdown module. In the module config select one or more roles to hide the Tree dropdown menu from.
  9. Regarding the Page Tree bookmarks, I found this comment in ProcessPageList.module: // support bookmarks only if already in use as bookmarks for ProcessPageList to be phased out Plus several other comments in the file to the same effect. Maybe this was announced and I missed it.
  10. 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": "" } }
  11. Could you please describe where the problem was and how you resolved it, in case people have similar problems in the future? Thanks.
  12. 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?
  13. 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.
  14. 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.
  15. 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?
  16. 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?
  17. 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.
  18. @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).
  19. 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.
  20. @LMD, thanks for the report. Please update to v.0.04 where this issue should be fixed.
  21. 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>";
  22. 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.
  23. I am referring to the Books parent page: https://ricardo-vargas.com/books/ Edit: we posted simultaneously
  24. 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/
  25. 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
×
×
  • Create New...