Jump to content

gebeer

Members
  • Content Count

    1,027
  • Joined

  • Last visited

  • Days Won

    23

Everything posted by gebeer

  1. Thanks again Soma, for your help. Your explanations again are really clear to understand. Based on what I know now, I will try and put the module together. @admins: I should have posted this in the modules forum. You're welcome to move it over there.
  2. Thanks Martijn. I just followed a link to Captain Hook on https://processwire.com/api/hooks/. When I browse http://processwire.com/api/hooks/captain-hook/ the site is working. Whom can I notify and inform about this issue? Github issues?
  3. Hello, I'm trying to learn more about hooks and visited Captain Hook. That page is currently not loading any styles and scripts. My console says: Blocked loading mixed active content "http://somatonic.github.com/Captain-Hook/css/anchor.css" Loading mixed (insecure) display content on a secure page "http://somatonic.github.com/Captain-Hook/hook.png" Blocked loading mixed active content "http://somatonic.github.com/Captain-Hook/js/jquery.js" Blocked loading mixed active content "http://somatonic.github.com/Captain-Hook/js/quicksilver.js" Blocked loading mixed active content "http://somatonic.github.com/Captain-Hook/js/main.js" Blocked loading mixed active content "http://somatonic.github.com/Captain-Hook/js/jquery.js" Blocked loading mixed active content "http://somatonic.github.com/Captain-Hook/js/quicksilver.js" Blocked loading mixed active content "http://somatonic.github.com/Captain-Hook/js/main.js"
  4. Now I'm aware of lightning.pw, too. Awesome!
  5. I t does have a title field in the template. Just renamed The Label there to "Login Name".
  6. OK, bummer. Blame on me not checking the source and stealing your time. Can I buy you a beer/soda/coffee? I'm using same menu code in a different project where no problems with menu rendering appeared so far. Actually I took the code from here. Found it: I had commented out a part in the rendering function that prevented displaying pages with children. Slapping myself hard now. Credits for solving this go to Soma.
  7. The profile page itself shows fine. But there should also be a menu item "Profiles" visible in the top menu bar next to "Home". when logged in as frontend user. That is my problem. I thought, too, that it wouldn't matter to have 2 different templates or only one. That was just the only difference that I noticed when comparing your settings to mine.
  8. my custom login definitely logs user in. You can see it on my def site which I pmed you details to.
  9. Thanks a ton! Only difference to my setup is that your login is through the default pw login page while mine is through the frontend.
  10. These are the access settings now for my Profiles page with template userprofiles The Profiles page still doesn't show in the menu, although it says in the settings: No - Pages may NOT not appear in searches/lists unless the user has access to view them My logged in user has role guest and frontend. Role frontend has these permissions: Sorry, I still can't see why the menu item would not be visible.
  11. I'll try harder first and get back here if I don't succeed. Thank you again for your help.
  12. That approach totally makes sense to me and fits my project requirements very well, especially since I also want to keep frontend users out from the admin area. My Profile page has guest view permissions removed. Only frontend user role is allowed to view it. But still it does NOT show up when frontend user is logged in. And I don't know why. You can see my role and template setup in my first post. So I guess something must still be wrong with my role/template access setup. Still lost on this one.
  13. Thank you Soma, for taking your time and explaining things that precisely. This really helped me to get a better understanding of the whole role and permissions concept. I will alter my frontend role like you suggested and add checks for $user->isLoggedin() && $user->hasRole("frontend") in my templates. If I get you correctly on the navigation render: It is expected behaviour that the Profile page does NOT show, right? So I need to render an extra users menu with links to their profile page and whatever else they need? Pls confirm. Thank you.
  14. Hi all, I'm struggling in putting together a process module. I want to trash all pages that belong to a specific user after the user has been deleted. I found one related thread by onjegolders where he is doing things the other way around. In my case I need a process module that hooks after user delete. And I would like to use the wire/modules/Process/ProcessPageTrash.module. It is my first time creating a pw process module. I have read through the basics of creating modules including the wiki article and looked at the code of ProcessPageTrash.module. But I'm having a hard time putting things together. This is what I've got so far: class ProcessCleanupUserPages extends Process { public static function getModuleInfo() { return array( 'title' => 'Cleanup User Data', 'version' => 0.1, 'summary' => 'Deletes all pages that where created by a user after user has been deleted', 'singular' => true, 'permanent' => false, 'permission' => 'user-admin', 'requires' => 'ProcessPageTrash', 'autoload' => "process=ProcessPageList", // What to add here - autoload only on user list page ); } public function init() { $this->users->addHookAfter('delete', $this, '___execute()'); // is this correct? } public function ___execute() { //get user ID $userID = $this->id or $event->id // How to get the user ID? //get all pages that were created by the deleted user $userPages = $pages->get("created_users_id={$userID}"); // syntax for trash pages - call module ProcessPageTrash on $userPages } protected function render() { // print out message to admin after pages are successfully trashed } } ?> I added comments with "???" where I don't know exactly what to do. Any help would be much appreciated. Thank you.
  15. The problem happened to be related to old session files that I transferred when moving to the new server. Once I deleted all session files in assets/sessions on the new server, PW picks up the $config->httpHosts array and the error message in the backend disappears.
  16. The problem happened to be related to old session files that I transferred when moving to the new server. Once I deleted all session files in assets/sessions on the new server, PW picks up the $config->httpHosts array. The error message in the backend disappears and I can create users and save their passwords without problems.
  17. @netcarver I added the link to that post. @onjegolders The profiles page is neither unpuplished nor hidden. It's template "userprofile" has access rules defined as per screenshot I supplied in my original post. I'm using this function to loop out my navigation: function renderChildrenOf($pa, $output = '', $level = 0) { $output = ''; $level++; foreach ($pa as $child) { $atoggle = ''; $class = ''; if ($child->numChildren(true) && count($child->parents) == 1) { $class .= 'dropdown'; $atoggle .= ' class="dropdown-toggle" data-toggle="dropdown"'; } else if ($child->numChildren(true) && count($child->parents) > 1 ) { $class .= 'dropdown-submenu'; $atoggle .= ' class="dropdown-toggle"'; } else if ($child->numChildren(true) && $child->id != 1) { $class .= 'dropdown-menu'; } // Makes the current page and it's top level parent add an active class $class .= ($child === wire("page") || $child === wire("page")->rootParent) ? " active" : ''; $class = strlen($class) ? " class='" . trim($class) . "'" : ''; if ($child->numChildren(true) && count($child->parents) == 1) { Add Caret if have children $output .= "<li$class><a href='$child->url'$atoggle>$child->title <b class='caret'></b></a>"; } else if ($child->numChildren(true) && count($child->parents) > 1) { $output .= "<li$class><a tabindex='-1' href='$child->url'$atoggle>$child->title</a>"; } else { $output .= "<li$class><a href='$child->url'$atoggle>$child->title</a>"; } // If this child is itself a parent and not the root page, then render it's children in their own menu too... if ($child->numChildren(true) && $child->id != 1) { $output .= renderChildrenOf($child->children, $output, $level); } $output .= "</li>"; } $outerclass = ($level == 1) ? "nav navbar-nav navbar-right" : 'dropdown-menu'; return "<ul class='$outerclass'>$output</ul>"; }
  18. I'm on the road. Will.supply the link tomorrow.
  19. After moving the site to the new host I have specified the new domain in the config file. But it is not recognized by PW. What ever I assign to $config->http hosts array, I always get that error.
  20. If you are talking about include paths in my templates, they are all correct.
  21. Thanks. Actually that is not my idea. Got it from another thread here.
  22. Thanks for the hint. But again, which path statements? Never had issues before when moving sites.
  23. Which path statements do you mean? Are they stored in the DB or in some config file? Can't find anything related to paths in config.php.
  24. I don't want to bloat the standard user profile. That is why I store all additional user info in those profile pages.
  25. Hello, I have a similar case like described in bwakad's post. But I don't want to ask there since the post is already marked as solved. My site has users with role "frontend" assigned that can edit their user profiles and add stuff on the frontend. frontend role setup: The user profiles are all stored in pages with template "userprofile" That template has these access settings: All user profiles live under a page "Profiles" that also has the template "userprofile": Now I would expect that the "Profiles" page only appears in the menu when a user with role "frontend" is logged in. But the menu item does not get displayed. I'm also using the function to display bootstrap menu item but bwakad's workaround seems a bit awkward (excuse the pun ). Does PW just work that way or is my access and permission setup wrong somehow? And how do I get the "profiles" menu item displayed only to users with role frontend?
×
×
  • Create New...