bolt not navigating to testimonial record page

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
gautamz07
Forum Contributor
Posts: 331
Joined: Wed May 14, 2014 12:18 pm

bolt not navigating to testimonial record page

Post 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"
User avatar
Celauran
Moderator
Posts: 6425
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: bolt not navigating to testimonial record page

Post by Celauran »

What about /testimonial/1 ?
User avatar
gautamz07
Forum Contributor
Posts: 331
Joined: Wed May 14, 2014 12:18 pm

Re: bolt not navigating to testimonial record page

Post by gautamz07 »

What about /testimonial/1 ?
Page testimonial/1 not found.

Thats the error i get.
User avatar
Celauran
Moderator
Posts: 6425
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: bolt not navigating to testimonial record page

Post by Celauran »

Do you have custom routes defined? Does adding slug/singular_slug to your contenttype help?
User avatar
gautamz07
Forum Contributor
Posts: 331
Joined: Wed May 14, 2014 12:18 pm

Re: bolt not navigating to testimonial record page

Post by gautamz07 »

I'll Try that Thanks .
User avatar
gautamz07
Forum Contributor
Posts: 331
Joined: Wed May 14, 2014 12:18 pm

Re: bolt not navigating to testimonial record page

Post 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 ?
User avatar
Celauran
Moderator
Posts: 6425
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: bolt not navigating to testimonial record page

Post by Celauran »

User avatar
gautamz07
Forum Contributor
Posts: 331
Joined: Wed May 14, 2014 12:18 pm

Re: bolt not navigating to testimonial record page

Post 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 :( :(
User avatar
Celauran
Moderator
Posts: 6425
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: bolt not navigating to testimonial record page

Post by Celauran »

Can you post your contenttypes.yml and routing.yml? Also, what do you mean by it doesn't work? 404?
Post Reply