Jump to content

Recommended Posts

Hello Processwire-Community,

i just wanted to greet you because i think its a better way to introduce myself.

I didnt found a better Thread to do this, so i think im not wrong to post this here. If i missed the specific Thread, then dont mind moving my ass there.

First of all, im German. Im 19 years old, very young and i have no idea how i found processwire. Maybe its because other CMS-Systems seems a little bit too packed for creating my stuff. If i wanna program something, i want to know why i writed this and where my mistakes are. Only then i can improve in this matter. So, with this in mind, i picked Pw, because most user say it gives a wide freedom to do stuff you wanna do.

I already started with my project, but there re some questions rolling in my head, so i wanna ask them here. If you have knowledge about it, i would appreciate it if you could give me an answer. If not, post some random bbcode-spam under this thread and think of something joyful :D .

1. Processwire gives the option to create pages and so on. Its useful, yes, but what if i wanna display only the content of a .php-file over the URL and place it in my template? So that i dont need to write my whole template for every .php-file that i include?

2. And while we are at it: how does the parent- and child-system work with the URL? If i, say, make an "foreach" for every link i have posted in a database-table called "navigation_links"  and now get the ROOT-path + this link, how can i tell processwire to accept it? If use use it like this:

<?php

foreach ($page_links as $link) {

     print "<li class=\"nav\"><a href=\"$link\"> $nameoflink</a><li>";

}

?>

and try to use it, it says to me "404 not found", but i just navigate it to the .php file i have created in my folder.

3. @ryan: i have read your post about the login-example here: https://processwire.com/talk/topic/107-custom-login/ .

if i wanna use this as an external .php-file, it works. But i wanna use it as an component on my site. For this, there is a little problem:

First of all, if i click on the Login-button, it does nothing. The Page stays where it is and doesnt redirect me to a page called "login_successful.php".

Second, if i watch in the database the session_throttle, it lets me stay in the attempts and the date. So the Informations didnt get transmitted. Here is the Code, i would appreciate it if you could give me help with this. Maybe im missing something. Please remember im just testing the functions. I will change it until i have my results.:

/templates/login.php (Makes decisions if a User is LoggedIn or not and includes the file i need)

<?php 
    if($user->isLoggedin()) {
        include("loggedin_form.php");
        
    } else {
        include("login_form.php");
    }
?>

/templates/login_form.php (Gives a Form to write username and password and transmit it)

 
<!-- This Form gives an login-form to login or register to the site-->
<?php 
    if($input->post->user && $input->post->pass) {
        $user = $sanitizer->username($input->post->user);
        $pass = $input->post->pass;
        
        if($session->login($user, $pass)) {
            $session->redirect("login_successful.php");
        } else {
            $session->redirect("login_unsuccessful.php");
        }
    }
?>

<div id="login_form">
    <?php if($input->post->user) echo "<h2 class='error'>Login failed</h2>"; ?>
    <form action='./' method='post'></form>
    <input type='text' value="Username" name='user' />
    <input type='password' value="password" name='pass' />
    <input type='submit' name='submit' value='Login' /></p>
</div>
 

Register will follow later, i will use another table for that.

4. If i wanna use an function-library, which folder-structure is identical to my components-folder and wanna limit every component i have in it to the "function" folder and dont allow other functions to work unless i say it in an "func_global.php", how can i do that? Over URL? Or do i need to make an attempt for everytime i call my component to search in the function-folder for a folder with the same name as the folder my .php file is placed in? This seems a little bit too much coding, so if someone has a better idea, please dont mind posting it here. I would appreciate it.

This seems enough for the start. Sorry for my bad english, i still need to learn stuff. But its better to ask than never know it.

With Greetings,

JamesHemmingworth

  • Like 4

Share this post


Link to post
Share on other sites

Servus James and welcome to pw!

1) I think what you are talking about is called delayed output. There is a tutorial here: https://processwire.com/docs/tutorials/how-to-structure-your-template-files/page4

And a helpful thread here: https://processwire.com/talk/topic/740-a-different-way-of-using-templates-delegate-approach/

2-4) sorry on mobile but don't really get your questions. Did you already do the hello world tutorial from the docs? Also have a look at the site profiles and as how Ryan does it ;)

Have fun with processwire und liebe grüße aus Wien :)

PS: I think one thread per question is easier to understand and answer

  • Like 1

Share this post


Link to post
Share on other sites

Welcome James! From your questions I'm assuming you're still not familiar with some of the basics of ProcessWire, I would suggest that you go though some of the tuts and get back to us if you have doubts while or after doing them http://processwire.com/docs/tutorials/

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By abdulqayyum
      Hy Processwire community,
      There are some problem in fileCompiler cache.
      when i change under the directory \site\templates\ it must change under the directory /site/assets/cache/FileCompiler/site/templates/
      but it does not update and functionality working with /site/assets/cache/FileCompiler/site/templates/ directory.
       
      In this case please suggest me how i clear fileCompiler cache?
      what i have to clear it manually?
      Thanks AbdulQayyum.
    • By abdulqayyum
      Hy everyone,
      i am using loginRegister module for front-end user login.
      In this module user can login with Email/username, i am showing with Email. done
      but not showing Email in Forgotton Password section. there still showing with username.

      i want to show Forgotton Password with Email instead username. and should reset with email.

      please help me in this section, how i can set it with Email.

      Thanks AbdulQayyum.
    • By abdulqayyum
      Markup-Google-Recaptcha is not working with LoginRegister module in Forgotton Password Form.
      Here is my code
      wire-> modules -> process -> ProcessForgotPassword.php
      protected function step1_renderForm() {
              $form = $this->modules->get("InputfieldForm");
              $form->attr('action', './?forgot=1');
              $form->attr('method', 'post');
          
              $field = $this->modules->get("InputfieldText");     
              $field->attr('id+name', 'username');
              $field->attr('class', 'redesign-field forgotPassFeild');
              $field->setAttribute('placeholder', 'Username');
              $field->required = true;
              $field->label = $this->_("Forgotton Password");
              $field->description = $this->_("If you cannot remember your password to access the affiliates portal. simply provide your username in the box below and we'll send you a reset link via email.");
              $form->add($field);
               
             // Calling MarkupGoogleRecaptcha Module.
              $captcha = $modules->get("MarkupGoogleRecaptcha");
             //  rendering form with recaptcha
              $captcha->render($form);
         
              $submit = $this->modules->get("InputfieldSubmit");
              $submit->attr('id+name', 'submit_forgot');
              $form->add($submit);
              $this->session->userResetStep = 1;
               
              // rendering form
               $out .= $form->render();
          
              // getting captcha script
              $out .= $captcha->getScript();
              return $out;
          }

      I am following this one example.

      please suggest me how i can show MarkupGoogleRecaptcha in forgotton password.
      Getting log error


      Thanks,
      Abdul Qayyum
    • By Mithlesh
      Hi there,
      My form is not getting submitted, it is showing:
      Unable to verify successful email delivery of this form submission.
      Attaching for your reference as well: 

      In the Backend, it is showing Connection timed out with smtp.gmail.com
      Pl guide me how to resolve that
    • By Sephiroth
      Hi guys, so since I moved to Processwire, it has been my default go-to CMF/CMS for my website and client applications, apparently my previous job took a toll on me, and made me have less time, but now finally had the chance to change my website to something I always had in mind.
      I decided to go with something minimal, as I tend to enjoy writing, so wanted a website to have more text than graphics and I think I whipped up something clean. Currently I still have more to do, but this is my current website, the main purpose to have a content driven website where I will be writing tutorials , articles more and hopefully  technical  notes.
      Please let me know your honest opinion.
      PS: I am more of a coder than a designer but i think this old dog still pulled it off
       
      https://okeowoaderemi.com/
       
       




×
×
  • Create New...