• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 832
  • Last Modified:

Working with WordPress PODS (plugin) - pulling data

I am trying to use the plugin PODS for wordpress - http://podscms.org/ - I went through the docs and the demo video. I have the basic understanding.

i have a POD with 3 fields:

 - ID
- TEXT
- TEXT

I am trying to get it to display on a WordPress page not a POD page. For instance the WP page.php.

I am using this:

 
<?php $item_id = 3; // You must find this ID manually! ?>
<?php
  
$pods = new Pod('course_information', $item_id);
echo $pods->get_field('course_outline');
?>

Open in new window


When I display the page, its not showing, I think its because it should be displayed using a POD page.

Any ideas?

Thanks!

0
catonthecouchproductions
Asked:
catonthecouchproductions
  • 7
  • 3
  • 2
1 Solution
 
jeremyjared74Commented:
I installed it and was able to get it to show up, but I used a custom page template to do it. I don't really have time to get to deep into this, but at first look it seems everything this plug-in or CMS does can be achieved within WordPress.A good understanding of WordPress custom fields and write panels can accomplish the same thing. It might turn out to be the next best thing, but like I said I only briefly looked into it.

I would follow this tutorial if I were you since it did output data for me. Maybe you can see the code and figure out what is wrong with yours.

http://mondaybynoon.com/2010/01/04/pulling-pods-data/
0
 
catonthecouchproductionsAuthor Commented:
Hey,

I am using this code now:

	<?php
//$p_id = shopp('product','id');
$p_id = 3;
$course = new Pod('course_information');
$params = array('select'=>'t.course_outline','where'=>'t.course_id = '.$p_id.'');
$course->findRecords($params);
while ($course->fetchRecord()) {
    echo $course->get_field('course_outline');
}
?>

Open in new window


I get a blank output. Still trying to look back at the docs to see if I missed anything
0
 
catonthecouchproductionsAuthor Commented:
I am using the WordPress Shopp plugin and the code is on the product.php page. And i tried the same code on page.php and same results.
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
catonthecouchproductionsAuthor Commented:
I tried this code and it returned blank:

<?php
/*
Template Name: PageOfPosts
*/


get_header(); ?>	


	<?php
//$p_id = shopp('product','id');
$p_id = 3;
$course = new Pod('course_information');
$params = array('select'=>'t.course_outline','where'=>'t.course_id = 3');
$course->findRecords($params);
while ($course->fetchRecord()) {
    echo $course->get_field('course_outline');
}
?>


<div class="content">	 
		<?php if (have_posts()) : ?>
		<?php while (have_posts()) : the_post(); ?>    
				<div class="entry">
					<?php the_content(); ?>
				</div>
			<?php endwhile; ?>
	     <?php endif; ?>
	</div>


<?php get_sidebar(); ?>
<?php get_footer(); ?>

Open in new window

0
 
catonthecouchproductionsAuthor Commented:
Looking in to write panels, might see how this will work. The main break down is this:

The overall site is for courses (in adobe products, etc). Then each course has its own course page, with a section that client needs to update, I have JS tabs for:

- course outline
- course description
- course certification

The JS tabs part is easy, but trying to find the best way to display each piece of data. And if WP can do WYSIWYG editing for write panels (these areas have bold, list, etc. styles.

Thanks!

0
 
jeremyjared74Commented:
I found a very useful plug-in on one of my most visited sources to get code or plug-ins when I don't have the time, or the money in a project to do things myself:

The plug-in is called WordPress Admin Class. What it does is give you the ability to add custom write panels on any post or page editor. It adds an additional TinyMce editor in the page/post editor and can be modified to almost no end. The instructions are very clear and well documented.
For $8 it has proven to be the best purchase I've ever made when it comes to WordPress

Here is the link:
http://codecanyon.net/item/wordpress-adminpage-class/115872
0
 
catonthecouchproductionsAuthor Commented:
Nice! ill look in to this. So these can be added to the page level?

Ryan
0
 
catonthecouchproductionsAuthor Commented:
Have you used this?
0
 
jeremyjared74Commented:
Yes I currently use this. It is very useful, and allows you to make generating content anywhere you want on a WP website.
0
 
gwkgCommented:
Try

echo $course->getTotalRows();

to see if you are are having a problem retrieving the records or displaying them.

If it is 0 then your problem is retrieving the rows.  If it is a number then your problem is displaying the rows.

It's been awhile since I used pods but I think your problem is t.course_outline and t.course_id aren't pod items.  Maybe they should be t.name and t.id

I'll have to dig up the old site I used it on and see how I did it tomorrow if you don't figure it out before then.
0
 
catonthecouchproductionsAuthor Commented:
Thanks @gwyg, ill try that.
0
 
gwkgCommented:
what happens if you drop the $params and just do

$course = new Pod('course_information');
$course->findRecords();
while ($course->fetchRecord()) {
    echo $course->get_field('course_outline');
}
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

  • 7
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now