PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Mon Oct 14, 2019 9:19 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 9 posts ] 
Author Message
PostPosted: Mon Jan 04, 2016 4:34 am 
Offline
Forum Contributor
User avatar

Joined: Wed May 14, 2014 12:18 pm
Posts: 331
In my contenttypes.yml file i have the following definition:

Syntax: [ Download ] [ Hide ]
#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

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

Syntax: [ Download ] [ Hide ]
{% 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"


Top
 Profile  
 
PostPosted: Mon Jan 04, 2016 7:36 am 
Offline
Moderator
User avatar

Joined: Tue Nov 09, 2010 3:39 pm
Posts: 6425
Location: Montreal, Canada
What about /testimonial/1 ?

_________________


Top
 Profile  
 
PostPosted: Mon Jan 04, 2016 8:21 am 
Offline
Forum Contributor
User avatar

Joined: Wed May 14, 2014 12:18 pm
Posts: 331


Top
 Profile  
 
PostPosted: Mon Jan 04, 2016 9:06 am 
Offline
Moderator
User avatar

Joined: Tue Nov 09, 2010 3:39 pm
Posts: 6425
Location: Montreal, Canada
Do you have custom routes defined? Does adding slug/singular_slug to your contenttype help?

_________________


Top
 Profile  
 
PostPosted: Mon Jan 04, 2016 10:26 am 
Offline
Forum Contributor
User avatar

Joined: Wed May 14, 2014 12:18 pm
Posts: 331
I'll Try that Thanks .


Top
 Profile  
 
PostPosted: Sat Jan 09, 2016 7:49 am 
Offline
Forum Contributor
User avatar

Joined: Wed May 14, 2014 12:18 pm
Posts: 331


Top
 Profile  
 
PostPosted: Mon Jan 11, 2016 8:00 am 
Offline
Moderator
User avatar

Joined: Tue Nov 09, 2010 3:39 pm
Posts: 6425
Location: Montreal, Canada
No, it would just be http://localhost:8080/boltCMS/testimonial/1

_________________


Top
 Profile  
 
PostPosted: Tue Jan 12, 2016 12:16 am 
Offline
Forum Contributor
User avatar

Joined: Wed May 14, 2014 12:18 pm
Posts: 331
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 :( :(


Top
 Profile  
 
PostPosted: Tue Jan 12, 2016 7:22 am 
Offline
Moderator
User avatar

Joined: Tue Nov 09, 2010 3:39 pm
Posts: 6425
Location: Montreal, Canada
Can you post your contenttypes.yml and routing.yml? Also, what do you mean by it doesn't work? 404?

_________________


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group