• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Register
  • Login
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
1.2k
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 8 Nov 2020, 13:55

    I want to edit the contact us page but do I have to follow the bagisto documentation or can I do it the traditional laravel way for creating the page and the flow. Because I don't fully I understand if I'm going to edit the page in the CMS option where exactly do I put the code that does the logic.

    1 Reply Last reply Reply Quote 0
    • V
      Vaishali Agarwal last edited by 9 Nov 2020, 08:41

      @MattWithCurls
      you can easily update or add content in contact us page by clicking here https://prnt.sc/vfyrb6

      1 Reply Last reply Reply Quote 0
      • M
        MattWithCurls last edited by 9 Nov 2020, 21:13

        @Vaishali-Agarwal Thanks bro will let you if I stumble upon any hurdles.

        1 Reply Last reply Reply Quote 0
        • 14 days later
        • M
          MattWithCurls last edited by MattWithCurls 23 Nov 2020, 16:24 23 Nov 2020, 16:14

          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 24 Nov 2020, 06:55

            @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 24 Nov 2020, 08:41 24 Nov 2020, 08:40

              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 25 Nov 2020, 10:56

                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 28 Nov 2020, 18:45

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

                  1 Reply Last reply Reply Quote 0
                  • M
                    MattWithCurls last edited by 4 Dec 2020, 11:50

                    This post is deleted!
                    1 Reply Last reply Reply Quote 0
                    • V
                      Vaishali Agarwal last edited by 5 Dec 2020, 14:50

                      @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 7 Dec 2020, 12:05

                        @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 7 Dec 2020, 12:18

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

                          1 Reply Last reply Reply Quote 0
                          • M
                            MattWithCurls last edited by 7 Dec 2020, 12:30

                            @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 7 Dec 2020, 13:34

                              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 7 Dec 2020, 13:44

                                Thanks @rahul

                                1 Reply Last reply Reply Quote 0
                                • M
                                  MattWithCurls last edited by 7 Dec 2020, 13:52

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

                                  1 Reply Last reply Reply Quote 0
                                  1 out of 16
                                  • First post
                                    1/16
                                    Last post