Bagisto Forum

    Bagisto

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    Do I have to use the CMS option to add a page ?

    General Discussion
    4
    16
    1269
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      MattWithCurls last edited by MattWithCurls

      For example lets say this is the form

      <h3>Contact Form</h3>
      
      <div class="container">
        <form action="/action_page.php">
          <label for="email">Email</label>
          <input type="text" id="email" name="email" placeholder="Your email..">
          
          <label for="fname">First Name</label>
          <input type="text" id="fname" name="firstname" placeholder="Your name..">
      
          <label for="lname">Last Name</label>
          <input type="text" id="lname" name="lastname" placeholder="Your last name..">
      
          <label for="subject">Subject</label>
          <textarea id="subject" name="subject" placeholder="Write something.." style="height:200px"></textarea>
      
          <input type="submit" value="Submit">
        </form>
      </div>
      

      So I can still create model,controller. But where do i place the route since bagisto is a package.

      @Vaishali-Agarwal

      1 Reply Last reply Reply Quote 0
      • devansh-webkul
        devansh-webkul last edited by

        @MattWithCurls,

        This depends if you are using Bagisto Standard you can place your routes and controllers stuffs in the default Laravel app.

        If you have taken a clone of the Bagisto repo then you can place your stuff in your package where it is more suitable.

        For e.g., if I am making changes in Velocity theme I will place in Velocity package.

        1 Reply Last reply Reply Quote 0
        • M
          MattWithCurls last edited by MattWithCurls

          Hi @devansh-webkul I'm using the one from the repo.

          1 Reply Last reply Reply Quote 0
          • devansh-webkul
            devansh-webkul last edited by

            Hi @MattWithCurls,

            If you are good too with the packages then you can place your routes and other stuff in velocity otherwise if you want to keep them separate you can place it in the default Laravel app as well.

            It's your choice.

            1 Reply Last reply Reply Quote 0
            • M
              MattWithCurls last edited by

              okay thanks @devansh-webkul will do that and get back to you.

              1 Reply Last reply Reply Quote 0
              • M
                MattWithCurls last edited by

                This post is deleted!
                1 Reply Last reply Reply Quote 0
                • V
                  Vaishali Agarwal last edited by

                  @MattWithCurls
                  you just need to add this form source code in admin-> CMS-> add page

                  once done, then go to the velocity-> meta -> footer middle content, here you need to pass the cms page url key.

                  1 Reply Last reply Reply Quote 0
                  • M
                    MattWithCurls last edited by

                    @Vaishali-Agarwal
                    I inserted the contact us source code but when I want to edit it in the CMS option the page is blank.

                    1 Reply Last reply Reply Quote 0
                    • M
                      MattWithCurls last edited by

                      I figured it out 👍. Just deleted the source code from the database.

                      1 Reply Last reply Reply Quote 0
                      • M
                        MattWithCurls last edited by

                        @Vaishali-Agarwal can i insert this type of source in cms for that form.

                        <!DOCTYPE html>
                        <html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
                        
                        <head>
                            <meta charset="utf-8">
                            <meta name="viewport" content="width=device-width, initial-scale=1">
                            <title>Laravel</title>
                            <!-- Bootstrap CSS -->
                            <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css">
                            <link rel="stylesheet" type="text/css" href="{{ asset('css/style.css') }}">
                        </head>
                        <body>
                            <div class="container mt-5">
                                <!-- Success message -->
                                @if(Session::has('success'))
                                    <div class="alert alert-success">
                                        {{Session::get('success')}}
                                    </div>
                                @endif
                                <form action="" method="post" action="{{ route('contact.store') }}">
                            @csrf
                            <div class="form-group">
                                <label>First Name</label>
                                <input type="text" class="form-control {{ $errors->has('first_name') ? 'error' : '' }}" name="first_name" id="first_name">
                                <!-- Error -->
                                @if ($errors->has('first_name'))
                                <div class="error">
                                    {{ $errors->first('first_name') }}
                                </div>
                                @endif
                            </div>
                            <div class="form-group">
                                <label>Last Name</label>
                                <input type="text" class="form-control {{ $errors->has('last_name') ? 'error' : '' }}" name="last_name" id="last_name">
                                <!-- Error -->
                                @if ($errors->has('last_name'))
                                <div class="error">
                                    {{ $errors->first('last_name') }}
                                </div>
                                @endif
                            </div>
                            <div class="form-group">
                                <label>Email</label>
                                <input type="email" class="form-control {{ $errors->has('email') ? 'error' : '' }}" name="email" id="email">
                                @if ($errors->has('email'))
                                <div class="error">
                                    {{ $errors->first('email') }}
                                </div>
                                @endif
                            </div>
                            <div class="form-group">
                                <label>Phone</label>
                                <input type="text" class="form-control {{ $errors->has('phone') ? 'error' : '' }}" name="phone" id="phone">
                                @if ($errors->has('phone'))
                                <div class="error">
                                    {{ $errors->first('phone') }}
                                </div>
                                @endif
                            </div>
                            <div class="form-group">
                                <label>Subject</label>
                                <input type="text" class="form-control {{ $errors->has('subject') ? 'error' : '' }}" name="subject"
                                    id="subject">
                                @if ($errors->has('subject'))
                                <div class="error">
                                    {{ $errors->first('subject') }}
                                </div>
                                @endif
                            </div>
                            <div class="form-group">
                                <label>Message</label>
                                <textarea class="form-control {{ $errors->has('message') ? 'error' : '' }}" name="message" id="message"
                                    rows="4"></textarea>
                                @if ($errors->has('message'))
                                <div class="error">
                                    {{ $errors->first('message') }}
                                </div>
                                @endif
                            </div>
                            <input type="submit" name="send" value="Submit" class="btn btn-dark btn-block">
                        </form>
                            </div>
                        </body>
                        </html>```
                        1 Reply Last reply Reply Quote 0
                        • R
                          rahul last edited by

                          Hi @MattWithCurls

                          Please insert as given below -

                            <form action="" method="POST">
                                  @csrf
                          
                                  <div class="form-container">
                                      <div class="control-group" :class="[errors.has('location') ? 'has-error' : '']">
                                          <label for="location" class="required">Zip Code</label>
                          
                                          <input type="text" v-validate="'required'" class="control" name="location" />
                          
                                          <span class="control-error" v-if="errors.has('location')">Above field is required</span>
                                      </div>
                          
                                      <button type="submit" class="btn btn-lg btn-primary" style="margin-top: 20px;">
                                          submit
                                      </button>
                                  </div>
                          
                              </form>
                          

                          and in admin like this - https://prnt.sc/vxij7d

                          Thanks
                          Rahul Shukla

                          1 Reply Last reply Reply Quote 0
                          • M
                            MattWithCurls last edited by

                            Thanks @rahul

                            1 Reply Last reply Reply Quote 0
                            • M
                              MattWithCurls last edited by

                              @rahul
                              So whats wrong with using the one i posted.

                              1 Reply Last reply Reply Quote 0
                              • First post
                                Last post