Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

36 Excellent

About Ralf

  • Rank
    Full Member

Profile Information

  • Gender
  • Location

Recent Profile Visitors

3,340 profile views
  1. Dear All and @flydev 👊🏻 i am currently creating a contact form and wanted to use the Google recaptcha for this. While implementing, I come across the following problem that I can not get solved... My page code structure looks something like this: <?php namespace ProcessWire; ?> <div id='content-body'> <div class='uk-grid' data-uk-grid> <div id='content' class='uk-width-1-2@m'> <?=page()->body?> </div> <div id='contactform' class='uk-width-1-2@m'> <h3>Contact Form</h3> <?php // Google reCaptcha as Modul $captcha = $modules->get("MarkupGoogleRecaptcha"); ...... // form was submitted so we process the form if($input->post->submit) { // Do cool stuff here <<<<-------- I cannot get in here } ?> <form class="uk-form-stacked" action="./" method="post"> <div class="uk-margin"> <label class="uk-form-label" for="name">Your Name <span class='uk-text-danger'>*</span></label> <div class="uk-form-controls"> <input type="text" name="name" class="uk-input" value="<?php echo $name?>" placeholder="Your Name here"> </div> </div> <div class="uk-margin"> <label class="uk-form-label" for="email">Your Email-Adress <span class='uk-text-danger'>*</span></label> <div class="uk-form-controls"> <input type="email" name="email" class="uk-input" value="<?php echo $email?>" placeholder="Email-Adress"> </div> </div> .... <div> <!-- Google reCaptcha code START --> <?php echo $captcha->render()?> <!-- Google reCaptcha code END --> </div> <div class="uk-margin"> <input type="submit" name="submit" class="uk-button uk-button-default" value="Submit"> </div> </form> <?php echo $captcha->getScript(); ?> </div> </div> </div> My problem is now, as soon as I insert this line of code "<?php echo $captcha->getScript(); ?>" on the page like this, my query "if($input->post->submit)" does NOT work anymore .... HELP what is wrong here or where is my mistake? Thanks Ralf
  2. You mean something along those lines? https://developers.google.com/fonts/docs/getting_started Google Fonts are used in your e.g. html code for the frontend, so an implementation in PW is not necessary. By the way, have you ever read up on the great ideas @dragan has for you?
  3. Hello everybody, I have a problem with a PW installation that i can't quite understand or i don't know where to look for forgotten settings? I have a separate member area in the frontend. When I click from page to page, I always get a new SessionID assigned. Until now this was not a problem, but now I wanted to store form data in a session variable and use it over several pages, but this is not possible, because it gets a new SessionID assigned every time I call another page? In the files I only found the following values: config.php /* * Your PHP has a configuration error with regard to sessions. * It is configured to never clean up old session files. Please correct this by adding the following to your /site/config.php file * */ ini_set('session.gc_probability', 1); and in every php file for a template I have this code in the first line: <? //This page is only displayed if a member is logged in, otherwise the user is redirected to the login mask. if($user->isLoggedin() != true) $session->redirect($config->urls->root.'access/login/', false); ..... Otherwise I would not be aware of any other code that could be responsible for such behavior 🤔 Is there any other setting for this topic in the backend or elsewhere? For tips I would like to thank you already now Thanks Ralf
  4. @Guy Incognito did you do everything renobird wrote in his post on page #4 of this thread? In particular "... In order for title to show as a connection option during your import, you need to add the title field to the user template file. ..." http://processwire.com/talk/topic/383-module-import-pages-from-csv-file/?p=10160 For me the import works, I just edited ~200 users.
  5. @bernhard many thanks for your PM help. For everyone else who might have the same problem as me, here are my implementation steps (no guarantee - I'm not a programmer) 1. activate URL segments (a good introduction can be found here: https://processwire.com/docs/front-end/how-to-use-url-segments/) 2. create my page WITHOUT URL segment (this shows the content + a button) 3. create a new page for the URL segment (e.g. /pdf) - this creates the PDF and displays it e.g. with show(). 4. it works 😎 My Code from No 2 (content + button) - mytemplate.php <?php if(strlen($input->urlSegment2)) throw new Wire404Exception(); switch($input->urlSegment1) { case '': // Segment 1 is empty so display main content <!-- my main content --> // My button to the PDF-creation-code echo "<a href='". $page->url ."pdf/' target='_new'>generate PDF</a>"; break; case 'pdf': // Display the PDF include 'mytemplate-pdf.php'; break; default: // Anything else? Throw a 404 throw new Wire404Exception(); } ?> My code for example from No 3 (PDF creation) - mytemplate-pdf.php <?php $pdf = $modules->get('RockPdf'); $mpdf = $pdf->mpdf; $pdf->set('SetHeader', 'This is my header text'); // Two different ways to generate an output $mpdf->WriteHTML('Hello World ' . date('H:i:s')); $pdf->write('<!-- my custom comment --> Foo Bar Foo Bar ...'); // Output $pdf->show(); // to directly show your file in the browser ?>
  6. @bernhard many thanks for this great module. I am currently testing how it works and I will be able to use it in the future. Unfortunately there is one important question for me at the moment: How do you integrate it into your site? 🤔 I would like to put the whole code into an own file (the pdf generation doesn't have to be done every time the page is loaded) and then trigger the pdf output via a link/button on my content page. A tip in the readme how this could look like in a live version (not only in tracy) would be great. Sorry to be stuck on this point.
  7. Dear @gmclelland, many thanks for the tips, especially the one with the checkbox I found very interesting. My customer doesn't want a comment function now, so I commented the whole thing out. The trick was in the "blog-post.php" file and then a chache problem with my browser why it didn't work at the beginning... Many thanks again for the tips cu Ralf
  8. @OLSA many thanks for the module that works great to set up and select! However, I still have a big problem... If i have selected an icon and then click on save, the information "Session: Saved Page: ...." appears on top. But when I want to leave the page I ALWAYS get a popup with the following error message (sorry translated from German) "This page asks you to confirm that you want to leave the page - data you have entered may not be saved." What am I doing wrong or is there an error in the CSS/JS? Can someone please help me? Thank you cu Ralf
  9. Dear processwire professionals, i have a question about the PW standard template "Regular". This template is great and I use it to create a new page with UIKit. But at the moment I still fail something due to a task... Is it possible to design the comment function for the blog part OPTIONAL? Which part of the code do I have to change if I don't want to allow a comment function for this homepage? I tried to comment out different lines in the file _uikit.php, but without success. The result were always PHP error messages... 😞 So now my question to the auditorium, if somebody could help me? If this question is already answered in the forum and I did not find it by my search, I apologize and would be happy about a link. Many thanks and many greetings Ralf
  10. Hello Can, I know the whole thing is a little older... but did you get any further back then? Have you been able to develop the whole thing into a module? Many thanks and many greetings to Peru
  11. Hello everybody, i have a question, which unfortunately i can't answer at the moment... A friend of mine is looking for a new homepage and asked me if it is possible to use PW to create a system with about 30-60 editors who can write articles/news in 3-5 "areas". But only have the possibility to either create NEW articles or edit their own articles. a) That means for user 1 the edit button is only allowed for his own articles, but not for articles from user 2 to 40. b) The new button should be displayed on the parent pages for all users. Excluded from this should be the SuperUser, be able to edit all articles. I'm sorry for a stupid question, but I'm on the line for a solution. 🙈 My question now to the professionals, is this possible and if so how do I have to set PW with rights and permissions? I would be very pleased about feedback! Thanks Ralf
  12. Help... After the update from 3.0.98 to 3.0.118 the complete page doesn't work anymore 😞 there is only one error message left: Parse error: syntax error, unexpected 'new' (T_NEW) in /www/htdocs/xxxxxxx/wire/core/WireArray.php on line 2480 this is the code in WireArray.php /** * Create a new WireArray instance of this type, optionally adding $items to it * * This method call be called statically or non-statically, but is primarily useful as a static method call. * * ~~~~~~ * // Create new WireArray with a, b and c items * $a = WireArray::new([ 'a', 'b', 'c' ]); * * // This also works when called statically (array syntax can optionally be omitted) * $a = WireArray::new('a', 'b', 'c'); * ~~~~~~ * * @param array|WireArray|mixed|null $items Items (or item) to add to new WireArray * @return WireArray * @since 3.0.117 * */ public function ___new($items = null) { $a = self::new($items); $this->wire($a); return $a; } Could anybody help? Thanks Ralf
  13. Hello together, I´m a bit confused about doing the output of the securefile respectively securefiles... Wanze wrote this code: if ($input->get->download == 1) { $yourSecureFile->download(); } Now I'm a little overstrained and need your help. I build a template at the frontend for secure files and I generate the current output with this code $content = $page->body; $pdffiles = wire("page")->file; foreach ($pdffiles as $pf) { $content .= "<a href='' title='{$pf->name}'>$pf->name</a> ($pf->filesizeStr)<br />"; } but how can I now tell this link which of the secure files the user wants? This is the current output... Thank you for any hint Ralf
  14. Hi kixe, thanks - but hmm strange, the output is now nothing. But it should be 2 or 5 entries output - if i insert 1045 or 1041 as ID value. Have you else any idea? PS: a second challenge is to combine it with a query after "$user->roles"
  15. Hi kixe, sure, I can try. /* Home | |- events (template: events -> field: title) | |- event (template: event -> fields: title, date, jobs (PageTable - with the template "job" for items) | | |- job A (template: job -> fields: title, select_task (Page), job_begin, job_end, select_place (Page), | | | staff_needed (Integer), select_group (Page - PageArray with "Roles" as the Parent of selectable pages), | | | participants (Page - PageArray with "Users" as the Parent of selectable pages)) | | |- job B | | |- job C | | |- job X | | |- job Y | | | |- event | |- job D | |- job E | |- job F | |- tasks (template: basic-page -> field: title) | |- task A (template: task -> field: title) | |- task B | |- places (template: basic-page -> field: title) | |- place A (template: place -> field: title) | |- place B sorry that i missed the jobs in the first page tree.
  • Create New...