newbie to Pods and Cannot get Detail Page to display

0

I am newbie to Pods. I cannot get a details page to display. Need help. I am following the simple beginner tutorial using Bunnies pod from the video on the User Guide. Here is my info: First my List page is displaying correctly. But when I click on "Easter Bunny" to go to the detail page I get a 404 error. Here is my code and settings: My WordPress Permalinks Settings are default

Pod Settings: Pod Name: bunny

Pod Settings Top Level Menu: checked Pod Label: Bunnies Detail Page: bunnies/{@slug}/

List Page page name: bunnies <h1>Bunnies</h1> <?php $pods = new Pod('bunny'); $pods->findRecords('t.name',-1); echo $pods->showTemplate('bunny_list');

Page Title: List of Bunnies

Detail Page

<?php global $pods; echo $pods->showTemplate('bunny_detail');

Detail Page PreCode:

<?php $slug = pods_url_variable(2); $pods = new Pod('bunny', $slug); if(empty($pods->data)) { wp_redirect("../"); die(); }

Detail Page Title {@name} | List of Bunnies

Templates List Template list template name: bunny_list

<p><a href="{@detail_url}">{@name}</a></p>

Templates Detail Template detail template name: bunny_detail

<h1>{@name}</h1> <p>Color of Rabbit: {@color}</p>

I created a WordPress page and placed this code: [pods name="bunny" template="bunny_list"]

Bunnies Page shows up in menu. Click on Bunnies page and get my main list of bunnies. The mainlist page works great! I click on a link "Easter Bunny" and get the following error:

Not Found

The requested URL /bunnies/easter-bunny/ was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

I tried doing a second tutorial similarly to the bunny tutorial, I get the same. My main list pulls the data and lists my data beautifully. But when I try to click on a link to get to a details page I get the same error.

Help PLEASE!! Thanks in advance for any help giving!

Darren

asked Oct 1 '11 at 4:46

redsoxfan2499

1

add comment
enter at least 15 characters

9 Answers

1

This is how i linked my list events to detailed page at templates _list.. <a href="{@id}">Link name</a>

Like you see i used @id, but by default it is @name...

Also when you open your list page end it with /

Ex.: www.yourpage.com/event_list/

answered Oct 1 '11 at 8:51

uldix

11

edited Oct 1 '11 at 8:51

add comment
enter at least 15 characters
0

@redsoxfan2499,

Have you tried this, this, and this tutorial? Hopefully that would help you.

answered Oct 1 '11 at 4:43

Masino Sinaga

41

add comment
enter at least 15 characters
0

OK. Guys, Thanks for your help but programming the pods is not the answer. I think it has to do with the permalinks in my wordpress system. Masino, I followed your videos step by step, when I go and browse my countries I entered, I can see the list, I can click on edit to edit them but when I click on view I get the 404 error. In your video I even tried going straight to the directoty but get the same error /countries/. Also in the countries manager when I click on View it goes to the correct directory and permalink (com/countries/indonesia) I still get the 404 error. Any help on setting up my permalinks. I cannot view pages at all through the pods system. But when I use short code and place the short code in a WordPress page I can get my list but no luck with the detail page. As my list will show up like a page com/?page_id=39 but when try to click on the details it goes to the correct directory but no luck .com/countries/indonesia . My WordPress system will not let me view my directories.

Thanks to everyone!! Darren

answered Oct 4 '11 at 3:23

redsoxfan2499

1

add comment
enter at least 15 characters
0

Try changing this line in your code:

$slug = pods_url_variable(2);

to this:

$slug = pods_url_variable(1);

In the tutorial all the pods stuff resides in a subdirectory: example.com/pods-demo/bunnies/easter-bunny. If your pods stuff is in your root directory, pods_url_variable(2) is undefined. You could also use pods_url_variable(-1) or pods_url_variable('last') for this.

answered Oct 4 '11 at 5:47

chris.pilko

889

add comment
enter at least 15 characters
0

Chris, i change my code and no luck:( I tried all 3 suggestions. Thanks for helping. Anyone else have any suggestions.

answered Oct 4 '11 at 11:35

redsoxfan2499

1

add comment
enter at least 15 characters
0

You have to use the WordPress permalink setting 'Custom' and enter the value /%postname%/

answered Oct 4 '11 at 11:59

eduu

1

add comment
enter at least 15 characters
0

@redsoxfan2499,

All right then, now please try what @eduu suggest. You have to use the WordPress permalink setting 'Custom' and enter the value /%postname%/ . I am surely this will solve your problem.

Cheers!

answered Oct 5 '11 at 2:18

Masino Sinaga

41

add comment
enter at least 15 characters
0

I had to make a new template and hand insert the pod display code and it worked like a charm

answered Oct 5 '11 at 6:43

sdoerr2

18

add comment
enter at least 15 characters
0

That did it! THANKS to everyone that helped me with my issues. All my pods seem to work great!

answered Oct 7 '11 at 4:04

redsoxfan2499

1

add comment
enter at least 15 characters