-
Posts
139 -
Joined
-
Last visited
Everything posted by hansv
-
@Robin S Thx for showing me the right direction, I used http://projects.jga.me/toc/
-
Maybe it's better to visualize In the body-field of a page there is content. 1 Lorem with H3-tag Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit sapien, pulvinar sit amet mi nec, consequat rhoncus nunc. Cras est urna, finibus ut elementum elementum, tincidunt id enim. 1.1 Lorem with H2-tag Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit sapien, pulvinar sit amet mi nec, consequat rhoncus nunc. Cras est urna, finibus ut elementum elementum, tincidunt id enim. 1.2 Lorem with H2-tag Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit sapien, pulvinar sit amet mi nec, consequat rhoncus nunc. Cras est urna, finibus ut elementum elementum, tincidunt id enim. 2 Lorem with H3-tag Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit sapien, pulvinar sit amet mi nec, consequat rhoncus nunc. Cras est urna, finibus ut elementum elementum, tincidunt id enim. 3 Lorem with H3-tag Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit sapien, pulvinar sit amet mi nec, consequat rhoncus nunc. Cras est urna, finibus ut elementum elementum, tincidunt id enim. In e.g. a sidebar (see below), the headers (h2, h3, may also h4) are generated, and when scrolling down the page-content (body-field), you scroll down to the headers in the sidebar. The tags are always, h2, h3 and h4 1 Lorem with H3-tag 1.1 Lorem with H3-tag 1.2 Lorem with H3-tag 2 Lorem with H3-tag 3 Lorem with H3-tag I try to find a way to generate the headers of the page-body-field and show them in a side-bar-panel. This is PW-related, the scrolling down part is for the front-end framework, e.g. Uikit. In the cheatsheet of PW I find way's to refer to page-fields (title, summary, body, ..) but I try to find a way to recognize specific html-content (headers, h2 -> h4) within the body-field.
-
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
-
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?
-
@adrian Als I see it know, this answer is the logic itself and it works very well. PW and its community is fantastic, thx
-
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.
-
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?
-
Module FrontendUser: login, logout and register users / members
hansv replied to pwFoo's topic in Modules/Plugins
@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. -
Module FrontendUser: login, logout and register users / members
hansv replied to pwFoo's topic in Modules/Plugins
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 -
Module FrontendUser: login, logout and register users / members
hansv replied to pwFoo's topic in Modules/Plugins
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')); -
Module FrontendUser: login, logout and register users / members
hansv replied to pwFoo's topic in Modules/Plugins
@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; } -
Module FrontendUser: login, logout and register users / members
hansv replied to pwFoo's topic in Modules/Plugins
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 -
@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.
- 7 replies
-
- responsive
- foundation
-
(and 2 more)
Tagged with:
-
@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
-
@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?
-
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> ";
-
Cannot edit or delete images in image field after update to 3.0.18
hansv replied to MarcU's topic in Getting Started
@Adrian I use the imageExtra module, not third party cropping module. Meanwhile I returned to 2.7.3, because the website is in production! -
Cannot edit or delete images in image field after update to 3.0.18
hansv replied to MarcU's topic in Getting Started
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? -
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>
-
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');
-
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;
-
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>
-
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
-
Return to home page is always to English (default) language
hansv replied to hansv's topic in Multi-Language Support
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 -
Return to home page is always to English (default) language
hansv replied to hansv's topic in Multi-Language Support
<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