Jump to content

hansv

Members
  • Posts

    137
  • Joined

  • Last visited

Everything posted by hansv

  1. hansv

    Scrolling sidebar

    Thx Kongondo & fbg13 for your replies. I think this is a pure PW-question, the integration of uikit is a side-issue. I can rephrase the question in different ways how can I make an index of page-content? how can I find all subtitles and paragraph titles in a page and show them together as a summary
  2. Ryan has opened my eyes with his skyscrapers2-demo. Uikit is really a fantastic frontend-framework. My question is about scrolling uikit-side-nav and the pw-code to use for the content. Is it possible to realize a scrolling nav-side-bar as the uikit-layout-example: https://getuikit.com/docs/layouts_documentation.html ? The scrolling-bar should show the headers for example h3 en h2 of the body-part of the page When scrolling down the page, the headers in the sidebar, e.g. h3 h2, show where you are in the page. Can anyone show me the way to the code to trigger e.g. the h3 and h2 headers?
  3. @adrian Als I see it know, this answer is the logic itself and it works very well. PW and its community is fantastic, thx
  4. Thx adrian and pwfoo for this quick answer. This code is working very well $person = $users->find('instrument=' . $instr); But my foreach loop doesn't work. I only get the first instrument.
  5. I extended my users-template with a lot af fields? One of them is 'instrument' The code beyond is working fine (see screenshot 1). 'instrument' is a page-select-field in the user template (the pages are violin, cello, clarinet, ...). But this is not nice and efficient coding!! // Violin $person = $users->find('instrument=violin'); echo "violin"; foreach ($person as $p) { // $user fields are shown echo $p->first_name; } // cello $person = $users->find('instrument=cello'); echo "cello"; foreach ($person as $p) { // $user fields are shown echo $p->first_name; } // clarinet $person = $users->find('instrument=clarinet'); echo "clarinet"; foreach ($person as $p) { // $user fields are shown echo $p->first_name; } // and so on With a foreach the code could me more efficient, but the find-selector givns a problem with the variable $instr. // all instrument in a foreach foreach ($user->instrument as $instr){ $person = $users->find('instrument=$instr'); // does not work, neither do find('$instr') and find($instr) echo $instr->title; foreach ($person as $p) { // $user fields are shown echo $p->first_name; } } With $person = $users-find($instr); only the value of $instr is shown (e.g. violin) but not the values of $p (e.g. first name of person. (see screenshot 2) How can I use a variable as find-selector?
  6. @pwFoo Problem solved. No blames to the FrontEndUser-module, all shame is for me!!! In my _main.php there was also code to log in. It was ment for a button to login. Conclusion: there was interference between login-code in the _main.php file and the login-code in the template file. Sorry for wasting your time, the FrontEndUser-module is excellent.
  7. I re-installed the module, now only the 302 redirect loop. My template-code <?php // load module $fu = $modules->get('FrontendUser'); // Additional LoginPersist and ProcessForgotPassword module integration (built-in) $fu->login(array('username','password','forgot')); // process login / form submit $fu->process($pages->get('/ledenzone/')->url); // output form $body .= $fu->render(); .htaccess the original PW 3.0, now changes maded When I login as a non-existing user, I get the 'login failed' message When I login as admin or as existing user I get the redirection loop I'm just logging in, it' not about a registration of a new user
  8. I exported my profile into a new PW installation and now I get a fatal error: Fatal error: Call to a member function login() on null in D:\xampp\htdocs\pwf6_str08\site\templates\account-login.php on line 8 Code line 8: $fu->login(array('username','password','forgot'));
  9. @pwfoo, thx for the debug-suggestion I deleted login() After debugging wit php exit: location of the problem in the FrondendUser.module switch case: $result = 1 if result === true before $this: $result = 1 $this->session->redirect($redirect, false); // User sucessfully registered causes the loop that terns in a 302-error Any suggestions for a solution? /** * Process user register with validated form input * @param string $redirect Redirect destination url */ public function process($redirect) { if ($this->form->fhProcessForm()) { switch ($this->action) { case 'Login': $result = $this->auth($this->userObj); break; case 'Register': $result = $this->save($this->userObj); break; } if ($result === true) { $this->session->redirect($redirect, false); // User sucessfully registered } else { $this->form->fhSubmitBtn->error($result); // Save user failed? echo 'save user failed: ' . $this; // } } return $this; }
  10. I have a redirection problem! in chrome: to many redirections in firefox: page is not redirected in a proper way My code with or without the if else, same problem the inlog form is shown correctly and when I go to the backend I'm logged in <?php if ($user->isGuest()) { // load module $fu = $modules->get('FrontendUser'); // prepare login form (default parameters) $fu->login(); // Additional LoginPersist and ProcessForgotPassword module integration (built-in) $fu->login(array('username', 'password', 'forgot')); // process login / form submit $fu->process($pages->get('/ledenzone/')->url); // output form $body .= $fu->render(); } else { // do logout } Any suggestions, many thx
  11. @flydev thx for this nice and clean F6-profile. Sorry for this attachement, I thought there was a problem to remove the images, but it's working fine.
  12. @Robin S I tried everything you suggested. As it should be working, it didn't, therefore I started from a new PW installation, and de login-form is working fine now! It is still a mystery, but I'm glad you confirmed the code was right and thx for all suggestions. hansv
  13. @Robin S, thx for your quick response $username and $password are holding the correct information I can login from the PW admin login Any other ideas?
  14. I read the many topics on this forum about login-forms from Ryan's post in 2012 to improvements of Renobirds and many other contributors. My login-template-file (that I found in the many topics and changed a little bit) is beneath. What's working: When I'm logged in, the redirect works correctly When I'm not logged in, the form is shown correctly, login failure message is shown What's not working: but the try ... catch goes always to the else-side. I made a new user to be sure the username and password are correct but login fails always. I'm working with PW 3.0.29 on localhost I hope someone can help me <?php $body = ""; if ($user->isLoggedin()) { $session->redirect($pages->get("/sidenav/ledenzone")->url); } if ($input->post->user && $input->post->pass) { $username = $sanitizer->username($input->post->user); $password = $input->post->pass; try { if ($session->login($username, $password)) { $session->redirect($pages->get("/sidenav/ledenzone")->url); // redirect after user login } else { $error = "Wrong username or password. Login failed."; } } catch (Exception $e) { $error = $e->getMessage(); } } $body .= " <div class='login-box'> <div class='panel panel-default'> <div class='panel-heading'> <h3 class='panel-title'><span class='lock-icon'></span><strong>Member Log-in</strong></h3> </div> <div class='panel-body'> <form role='form' action='./' method='post'> <div class='message-error'>$error</div> <div class='form-group'> <label for='user'>Username</label> <input type='text' name='user' id='user' class='form-control' placeholder='Username' /> </div> <div class='form-group'> <label for='pass'>Password</label> <input type='password' name='pass' id='pass' class='form-control' placeholder='Password' /> </div> <button type='submit' class='btn btn-sm btn-primary'>Login</button> </form> </div> </div> </div> ";
  15. @Adrian I use the imageExtra module, not third party cropping module. Meanwhile I returned to 2.7.3, because the website is in production!
  16. In PW 3.0.28 the problem still exists. I use an image field that provides the images for my slider, but can't delete the 'wrong' images. A little bit annoying! Is there a solution?
  17. Oops ... Problem solved! Code beneath should be in home.php and not in _main.php Sorry for this rather stupid mistake! <div id="modalwin" class= "reveal-modal tiny" data-reveal aria-labelledby="modalTitle" aria-hidden="true" role="dialog"> <?php if(!$session->noPop){ echo $pages->get("/inthepicture/baie-musiek")->body; $session->noPop = 1; } ?> <a class="close-reveal-modal" aria-label="Close">×</a> </div>
  18. I have a similar question for my Home page. My Zurb Foundation 5 reveal modal page is showing on my home page. When reloading or view another page, the modal page stays as empty page. It never disappears as it should be! You can see this at orgelpijpjes.be . My code: <link href="http://cdnjs.cloudflare.com/ajax/libs/foundicons/3.0.0/foundation-icons.css" rel="stylesheet"> <div id="modalwin" class= "reveal-modal tiny" data-reveal aria-labelledby="modalTitle" aria-hidden="true" role="dialog"> <?php if(!$session->noPop){ echo $pages->get("/inthepicture/baie-musiek")->body; $session->noPop = 1; } ?> <a class="close-reveal-modal" aria-label="Close">×</a> </div> $(document).foundation(); $('#modalwin').foundation('reveal','open');
  19. Thx AndZyk & pwired HTML5 -> I am unable to make the 'scr' refer to the correct path <video id="yourmovie" src="yourmovie.mp4" controls></video> Adriaans video field type is working well, except of showing an image of the video and to make it autoplay! echo $page->videos->eq(0)->play;
  20. Thx AndZyk I also tried this, but I only see the controls, the video itself is not visible. The problem is to refer correctly to the source <video width="320" height="240" controls> <source src="<?php echo $config->urls->templates; ?>video/voorstelling_orgelpijpjes_2016.mp4" type="video/mp4"> </video>
  21. I want to embed flex-video from Zurb Foundation (no Youtube or Vimeo), but video stored on your own hosting server. This is working fine (= example flex-video on Zurb Foundation site) <div class="flex-video"> <iframe width="420" height="315" src="https://www.youtube.com/embed/V9gkYw35Vws" frameborder="0" allowfullscreen></iframe> </div> When I try ' to processwire' this I get a 404-error <div class="flex-video"s> <iframe width="420" height="315" src="<?php echo $config->urls->templates; ?>video/voorstelling_orgelpijpjes_2016.mp4" frameborder="0" allowfullscreen></iframe> </div> How can I refer the scource (scr) to my own mp4-video? Suggestions are welcome
  22. Thx Horst, your solution is working. After changing my _main.php I didn't upload the file. How can I be so stupid! Many, many thx
  23. <a href="<?php echo $pages->get('/')->url; ?>"> has no effect I made a 'Home'-button in the menu. In attachement dutch-version. When pressing on Home-menu-button, the sites stays in the dutch language. When pressing the logo, the sites turns to the English version in stead of staying in the dutch language version. It seems that the logo is 'outside' the multilanguage
  24. No LostKorbrakai, the code-listing my code before I asked the question. With this code multi-language works perfect, except pressing on the logo gives always the english page (default). The 'landing-page' is always the English page. In my menu, there is no 'Home'-button, the logo serves as home button
  25. $pages->get('/') is working fine as you can the code underneath (MarkupSimpleNavigation) --------------------------- _main.php --------------------------- <div id='topnav'> <div class='contain-to-grid'> <!-- <nav class="top-bar"> --> <nav class="top-bar" data-topbar> <ul class="title-area"> <li class="name"> <!--substitute in your own logo or text here--> <h1> <a href="<?php echo $config->urls->root; ?>"> <img id='logo' src='<?php echo $config->urls->templates; ?>styles/images/logo.png' width='180' height='200' alt='L' Aigle - Oostende' /> </a> </h1> </li> <li class="toggle-topbar menu-icon"> <a href="#"><span>menu</span></a> </li> </ul> <section class="top-bar-section"> <ul class="right"> <?php $treeMenuTop = $modules->get("MarkupSimpleNavigation"); // load the module $options = array( 'max_levels' => 1, 'show_root' => true ); $rootPage = $pages->get("/");; echo $treeMenuTop->render($options,null,$rootPage); // render default menu ?> <?php if($page->editable()): ?> <li class='divider'></li> <li class='has-form'> <a class='tiny success button' href='<?php echo $config->urls->admin . "page/edit/?id=$page->id"; ?>'>Edit</a> </li> <?php endif; ?> <li class='divider show-for-small'></li> <li class='search has-form show-for-small'> <!-- this search form only displays at mobile resolution --> <form id='search-form-mobile' action='<?php echo $config->urls->root?>search/' method='get'> <input type="search" name="q" value="<?php echo $sanitizer->entities($input->whitelist('q')); ?>" placeholder="Search" /> </form> </li> <!-- devider --> <li class="divider"></li> <!-- languages --> <?php // language switcher foreach($languages as $language) { if(!$page->viewable($language)) continue; // is page viewable in this language? // $url = wire('page')->localUrl($language); if($language->id == $user->language->id) { echo "<li class='current'>"; } else { echo "<li>"; } $url = $page->localUrl($language); $hreflang = $homepage->getLanguageValue($language, 'name'); echo "<a hreflang='$hreflang' href='$url'>$language->title</a></li>"; } ?> </ul> </section> </nav> </div> </div><!--/#topnav-->
×
×
  • Create New...