excluding featured project from pods list
Hi
I have a featured project list which displays the project which a user has selected, here's the code:
<?php
// Find the slug name from the URI
$slug_name = pods_url_variable('last');
// Find the event item with this slug name
$Record = new Pod('wk3_work', $slug_name);
// Call the "event_detail" template
echo $Record->showTemplate('what_slideshow');
?>
I then just beneath that featured project I have a list of other projects which have been recently uploaded, here is that code:
<?php
$Record = new Pod('wk3_work');
$Record -> findRecords('ID DESC', 3, "(wk3_project_type.name = 'brand')");
echo $Record->showTemplate('what_detail');
?>
I would love to exclude the featured project from the pods list beneath it but I don't know how to do this.
Any help will be gratefully appreciated.
Thank you!
3 Answers
You're almost right, @Fike. The "slug" field is not the same as the "name" field, so your code should be changed to:
<?php
$Record = new Pod('wk3_work');
$Record -> findRecords('ID DESC', 3, "(wk3_project_type.name = 'brand' AND t.slug != '$slugname')");
echo $Record->showTemplate('what_detail');
?>
edited Jun 30 '10 at 6:57
You can use two where clauses here too, i think:
<?php
$Record = new Pod('wk3_work');
$Record -> findRecords('ID DESC', 3, "(wk3_project_type.name = 'brand' AND t.name != $slugname)");
echo $Record->showTemplate('what_detail');
?>
i'm not sure this code is right, but as i understand - it should be something like this.
Thanks guys, the code works!
I just changed the $slugname to $slug_name it it works perfectly!
I totally love this forum because people are so helpful!
Thanks again.


