excluding featured project from pods list

0

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!

asked Jun 30 '10 at 8:13

terri

1

add comment
enter at least 15 characters

3 Answers

1

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');
?>

answered Jun 30 '10 at 6:56

clarinetlord

456

edited Jun 30 '10 at 6:57

add comment
enter at least 15 characters
0

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.

answered Jun 30 '10 at 5:35

Fike

208

add comment
enter at least 15 characters
0

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.

answered Jul 1 '10 at 6:28

terri

1

add comment
enter at least 15 characters