Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

22 Excellent

About lpa

  • Rank
    Distinguished Member

Profile Information

  • Gender
  • Location
    Helsinki, Finland

Recent Profile Visitors

6,554 profile views
  1. I have two questions: 1. Why does this code: $content .= $img->render([ 'alt'=> $img->name, 'height' => $img->height, 'width' => $img->width, 'srcset' => '883, 687, 369', ]); generate this where I have the portrait sizes setting even though I haven't set the portrait mode on? <img src="/site/assets/files/1185/image.691x499.jpg" alt="image" srcset="/site/assets/files/1185/image.369x266-srcset.jpg 369w, /site/assets/files/1185/image.687x496-srcset.jpg 687w, /site/assets/files/1185/image.jpg 883w" sizes="(orientation: portrait) and (max-width: 768px) 50vw"> How is the portrait mode set on? I think, it needs 'portrait' => true or srcset('true') 2. render should extend PageImage::render, but the width or height attributes don't remain in my code with the above example. Why is that?
  2. I tried to add the page id to be searchable in the admin Ajax search-field. The help message says the field has to be text-based: "Enter the names for one or more text-based fields that you want to search, separating each by a space." Is there any way to add the page id to be searchable?
  3. Well, it seems to work if I leave the parent of the subtree documents to the old path like this: Move the subtree under the new parent path2: /path1/subtree1/article1/ -> /path2/subtree1/article1/ article1 (path: /path1/subtree1/article1/) is redirected to /path2/subtree1/article1/ if /path1/subtree1/ is not removed. If that is removed, /path1/subtree1/article1/ is shown in the browser address even though the page shown is /path1/subtree1/. And no 404-error is shown even though the page /path1/subtree1/article1/ does not exist any more.
  4. Thank you for the suggestion. I know we could do that and maybe we do. But if we still need to keep something under /canines/, that option won't work. And if the moves of the documents are done by editors, they don't know about or have access to redirect rules in .htaccess.
  5. I have a need to move a whole subtree of pages at once to another path. I would like the Page Path History -module to take care of the redirection of the old path locations to the new parent. But it seems to me that I have to move every single page individually for the move to register in Page Path History. Should this module handle the whole subtree or just the top level? Do I need to move the pages using API for the history to save with the move?
  6. I would like to replace the Ryan's original MarkupGoogleMap with this module. I installed this MarkupLeafletMap and tried to change the Map Marker fieldtype to Leaflet Map Marker. But it seems these fieldtypes are not compatible with each other. What should I do to change the old field with its over 200 pages to use this fieldtype?
  7. lpa

    Page Protector

    @adrian has a great support on his modules! All the problems solved with his help a long time ago! Thank you very much! And this module is great for cases where the PW template based access rights scheme is not so flexible.
  8. You can find my other message on the issue here on the HelperFieldLinks thread. It is supposed to give quick access to the templates and fields for superusers.
  9. lpa

    Page Protector

    1. I'll send you a private message on this. 2. Thanks, the $page->prohibited works just as I wanted based on a quick test. 3. At the moment I have a login.php file that is included on every page in _init.php. That page has my own logic without PageProtector. There, if I need the login form, I can format it just like I want and even use the getRandomPict()-function which is in _func.php. But if I use the PageProtector I use the $page->loginForm, as show above, where I can't use my getRandomPict()-function, because it is not a PW template. I get errors like: "Call to undefined function getRandomPict()". I don't want to add the image to every template.
  10. lpa

    Page Protector

    1. No, the protection is not taking in account the role at all. Even if I change just one page without child protection to be protected, I can access that page after login with a user account that does not have the required role! 2. Yes, $page->protected works, but it does not make any difference on who is accessign the page. Should it give different results based on the users roles? I would like to make it to not show the navigation item if the page is protected for that particular user. 3. What is actually the message the hook returns? I would like something like this: // Give me a random picture to the login page $image = getRandomPict($homepage); $content = " <div class='row'> $page->loginForm <div class='large-12 columns'> $image </div> </div> "; $event->return = $content;
  11. lpa

    Page Protector

    I have pages like this: Page1 - page1.1 - page1.2 Page1 has been given access to roles: musician, assistant. Page1.2 has been given access to role musician only. When logged out, both pages ask to be logged in. When logged in as the user with only assistant role, I still can see the page1.2. I can't figure out why the roles based restrictions don't work at the moment. How should I debug this? Second question: can I hide the page1.2 from the user with assistant role in my navigation somehow? What should I do in my navigation script to hide the pages that the used doesn't have view access to? Third question: I need to customize the login-form by including some content from PW, but now when the customized login-form is not a PW form, I can't run any functions from the PW templates. How should I customize the login-form content when I need something more than just the form?
  12. Great, I think that will be enough for my needs.
  13. Thanks! Off course one option could be to use the normal user admin, but can it be restricted to allow editing users or creating new users with only a restricted set of roles?
  14. I have tried to use front-end editing using the <edit> tags. It seems, that I always get the history tab below the fields I am editing even though those fields are not under version control. Is there any option not to show the history tab with front-end editing modals?
  15. I need a solution to give some admin users a front-end page where they can create new users and edit existing ones. The existing and new users should only belong to a restricted set of roles. Is there some ready examples or modules to do this?
  • Create New...