Wally Kolcz
Wally Kolcz

Reputation: 1664

Custom Pods.io detail page

I am attempting to create a custom template page for a details page for my Pods.io 'research_faculty' pod.

I have the url going currently to /people/details and it does go to that page but I created a 'details' page that I have assigned a custom template to display the information that I want. Problem I am having is that its treating the last part of the URL as a page and Wordpress is saying page cannot be found. So it would be /people/details/wally-kolcz. How can I use the past part of the URL as the way to pull the person's details and populate the template page rather than WordPress trying to use it as another page and defaulting to the single.php template?

Pod (Advanced Options) Custom Rewrite Slug: people/details

Upvotes: 1

Views: 904

Answers (2)

Leon
Leon

Reputation: 1

Um create a pods page and on the Enter page URL section enter /people/details/* so that it responds to /people/details/+ anything. Also in the slug section u can try putting {@url,2} If it doesnt work. Also go to the advanced options of your advanced content type and in the detailed page URL enter pod_name/{@permalink} though that may not be necessary but try that and test it again.Make sure the pods page also has a pod to refer to and that it points at your php details template

Upvotes: -3

JPollock
JPollock

Reputation: 3558

You can use pods_v( 'last, 'url' ); to get the last segment of the url. If you put that in a variable you can use it to build your Pods object.

// get current item
$slug = pods_v( 'last', 'url' );

// get pods object for current item
$pods = pods( 'pod_name', $slug );

See this tutorial for more information: http://pods.io/tutorials/using-pods-pages-advanced-content-types/

Upvotes: 1

Related Questions