Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/07/2012 in all areas

  1. It's a bug. Thanks for finding this, and for the excellent description on how to duplicate it. I was able to duplicate easily, and have committed a fix to the source. This bug has apparently been there since the beginning. I'm guessing not many have used manual sorting with pagination, which is why it's not turned up earlier. Glad to have this one fixed--a particularly annoying bug for sure. Sorry for the inconvenience it caused you. Please let me know if the fix does or doesn't resolve it from that end too.
    5 points
  2. Hi, I've come across this issue which I can't work out and it's causing a bit of confusion. I have my child page list split over 3 pages: If I'm on page 2 and decide to move eg: 'coral reef' below page '0030' the entire tree order gets jumbled up. Has anyone else come across this? (Please, don't anyone try this on a live site. I have and it does screw up the order.) A more illustrated example: Regards Marty
    3 points
  3. OK, figured it out: public function init() { $this->session->addHook('login', $this, 'on_login'); } public function on_login (HookEvent $event) { if ($this->user->hasRole("editor")) { $this->session->redirect($this->pages->get(1065)->url); } } Thanks ya'll!
    2 points
  4. Textile v2.4 is now out. Check the change-log for anything new.
    2 points
  5. Hey rob. What diogo said. You can create a admin page using the "admin" template. It would be placed under the locked "admin" page tree. The admin template has a field "Process". After creating the page you'll see it under tab "content". Now you have to create a process module to serve functionality for the newly created admin page. Once installed it can be selected from the field "Process". I did a quick example that shows such a module, and even how to use the ProcessPageList module of processwire to create a tree. The id set will be the parent page (your Architects) for example. ProcessPageListCustom.module create the module under /site/modules/ and install it. <?php class ProcessPageListCustom extends Process{ public static function getModuleInfo() { return array( 'title' => 'Custom Page List', 'summary' => 'List pages in a hierarchal tree structure', 'version' => 100, 'permission' => 'page-edit' ); } public function execute(){ $pl = $this->modules->get("ProcessPageList"); $pl->set('id',1001); // or any other parent page return $pl->execute(); } } You can, of course, use any code to generate a list of pages.
    2 points
  6. Ryan, Thanks this gave me a great place to start. I thought I'd share the version I created in case anyone finds it useful. • Single template for the login/logout. • Automatically redirects the user back to whatever page they originally requested after they login. ./includes/login.php <?php // Handle logouts if($input->get->logout == 1) { $session->logout(); $session->redirect($page->path); } // If they aren't logged in, then show the login form if(!$user->isLoggedin()){ // check for login before outputting markup if($input->post->user && $input->post->pass) { $user = $sanitizer->username($input->post->user); $pass = $input->post->pass; if($session->login($user, $pass)) { // login successful $session->redirect($page->path); } else { $session->login_error = 'Login Failed. Please try again, or use the forgot password link below.'; } } ?> <!DOCTYPE HTML> <html lang="en"> <head> <title>Custom PW Login</title> </head> <body> <form action='./' method='post'> <div class="login"> <? if($input->post->user && $input->post->pass) { echo "<p class='error'>" . $session->login_error . "</p>"; }?> <p><input type='text' id="user" name='user' placeholder='Username'/></p> <p><input type='password' id="pass" name='pass' placeholder="Password" /></p> <p><input type='submit' class="btn" name='submit' value='Login' /></p> </div> </form> </body> </html> <? die(); // don't go any further if not logged in } // end !logged in ?> In any template you wish to protect: <? require("./includes/login.php");?> To trigger a logout: <a href="?logout=1">Logout</a> Note: I'm using the HTML5 placeholder attribute. Browser support is not 100%. You may want to use labels instead, or use some jQuery (like I did) to add the placeholder text for browser that don't support it. SideNote: How do you get code indents to stick when posting? I'm having to go back and add spaces to each line. I use tabs when coding.
    1 point
  7. Someday we'll definitely have to have ProcessWire US meetup. Atlanta seems to be pretty quiet from a web development community aspect. I've been here for 9 years and don't know any other web developers around. On the other hand, Atlanta has the world's busiest airport and a worldwide air traffic hub of sorts (i.e. easy to get to). Still, I think if folks are traveling by air then it's better to combine it with a larger conference to maximize the value for everyone. For instance, an interactive conference like SXSWi in Austin, TX or something a little smaller. So there would be a ProcessWire meetup, but within the context of another related conference. I think that would be the ideal way to go for a US meetup since everything here is spread out a lot further than in Europe. I'm guessing it's a lot easier to have a dedicated meetup in Europe because things are closer and transportation options are much better (trains, etc.).
    1 point
  8. Hi, and welcome to the forum! What you are asking is not that simple because this is not the way that ProcessWire is designed to work. It's not impossible though, and if you have the skills to create a module you can do it. I can't help you a lot with this, but maybe someone who can will jump in the discussion. What I can do is help you to get started. Here it goes To make a page appear in the admin navigation, you just have to make sure that it is children of the admin page in the tree. You can do this with any page with any template. If you want this page to behave and look like the other admin pages, you will have to give it the admin template... go ahead an try it... when you do this, the page will simply say "This page has no Process assigned". This means, you will have to create a process module that does what you want and assign it to the page you created. If you edit the page and choose from the several processes that already exists, you can see how it works. The process modules are on the wire/modules/Process folder of your PW install, have a look at some of them to get a feel of how it works.
    1 point
  9. We should try for an Atlanta PW Meetup. I have not been to Atlanta yet. We can exchange methods and secrets, even if we have to travel...
    1 point
  10. Of course if it may be helpful for anyone let's leave it here. Anyone interested may find these links helpful: Choosing an API Choosing a library
    1 point
×
×
  • Create New...