Page 1 of 1

bolt not navigating to testimonial record page

Posted: Mon Jan 04, 2016 3:34 am
by gautamz07
In my contenttypes.yml file i have the following definition:

Code: Select all

#Testimonials
testimonials:
    name: Testimonials
    singular_name: Testimonial
    fields:
        name:
            type: text
            class: large
        position:
            type: text
        body:
            type: textarea
            height: 150px
    listing_template: testimonials.twig
    record_template: testimonial.twig
using the admin panel i have populated the testimonials database with 2-3 records , now i believe , when i navigate to http://localhost:8080/boltCMS/Testimonial/1

i should see the testimonial.twig in action ? I.E. the below file:

Code: Select all

{% include '_header.twig' %}

<main>
  <div class="container">
    <div class="page-header">
      <h1>Testimonial!</h1>
      <p>This is a testimonial.</p>
    </div>
    <div class="page-content">
      <p>Testimonial content...</p>
    </div>
  </div>
</main>

{% include '_footer.twig' %}
But instead i get an error thrown, That says the following:

No route found for "GET /Testimonial/1"

Re: bolt not navigating to testimonial record page

Posted: Mon Jan 04, 2016 6:36 am
by Celauran
What about /testimonial/1 ?

Re: bolt not navigating to testimonial record page

Posted: Mon Jan 04, 2016 7:21 am
by gautamz07
What about /testimonial/1 ?
Page testimonial/1 not found.

Thats the error i get.

Re: bolt not navigating to testimonial record page

Posted: Mon Jan 04, 2016 8:06 am
by Celauran
Do you have custom routes defined? Does adding slug/singular_slug to your contenttype help?

Re: bolt not navigating to testimonial record page

Posted: Mon Jan 04, 2016 9:26 am
by gautamz07
I'll Try that Thanks .

Re: bolt not navigating to testimonial record page

Posted: Sat Jan 09, 2016 6:49 am
by gautamz07
@celuaran , can you give me an example of how exactly a slug/singular_slug , would look like sorry for the noob question , but i am just a bit confused:P

The documentation page here

says the following:
singular_slug (optional): This determines the slug of the a single record in this contenttype, and therefore the URLs that are generated for these records. When omitted, the slug will be automatically generated.
so does that mean that if in my contenttype of testimonials , if i have my singular_slug property set to "testimonial" , so now if i navigate to http://localhost:8080/boltCMS/testimonials/testimonial1 , i should see my 1st record ? , is that how bolt works ?

Re: bolt not navigating to testimonial record page

Posted: Mon Jan 11, 2016 7:00 am
by Celauran

Re: bolt not navigating to testimonial record page

Posted: Mon Jan 11, 2016 11:16 pm
by gautamz07
I tested with the default showcase contenttype (just made a listing.twig and record.twig) and using the following URL's

http://localhost:8080/boltCMS/showcases/1

http://localhost:8080/boltCMS/showcases

(ofcourse in the templates i am iterating over the record/records and echoing them. )

It worked !!

But with my custom contenttype my Url's don't work :( :(

Re: bolt not navigating to testimonial record page

Posted: Tue Jan 12, 2016 6:22 am
by Celauran
Can you post your contenttypes.yml and routing.yml? Also, what do you mean by it doesn't work? 404?