SHOW:
|
|
- or go back to the newest paste.
1 | // Controller code: | |
2 | ||
3 | function PortfolioItems() { | |
4 | - | $start = isset($_GET['start']) ? (int) $_GET['start'] : 0; |
4 | + | |
5 | - | $limit = 3; //set limit to how many portfolio items to show |
5 | + | |
6 | else | |
7 | $typeFilter = "AND `PortfolioPage`.ProjectType='" . $this->urlParams['Action'] . "'"; | |
8 | ||
9 | $records = PortfolioPage::get()->filter(array( | |
10 | "ParentID => $this->ID, | |
11 | ))->where($typeFilter)->limit(3); | |
12 | ||
13 | - | ))->where($typeFilter); |
13 | + | |
14 | ||
15 | } | |
16 | ||
17 | ||
18 | // template render: | |
19 | ||
20 | <% if PortfolioItems.MoreThanOnePage %> | |
21 | <div class="pagination"> | |
22 | <% if PortfolioItems.PrevLink %> | |
23 | <a href="$PortfolioItems.PrevLink"><span><img src="/themes/LittleMonkey2011/images/buttons/previous_off.png" id="previous" width="27" height="27" alt="previous" /></span></a> | |
24 | <% end_if %> | |
25 | ||
26 | <% control PortfolioItems.Pages %> | |
27 | <% if CurrentBool %> | |
28 | <span><img src="/themes/XX/images/buttons/page{$PageNum}_on.png" id="page{$PageNum}" width="27" height="27" alt="page{$PageNum}" /></span> | |
29 | <% else %> | |
30 | <a href="$Link"><span><img src="/themes/XX/images/buttons/page{$PageNum}_off.png" id="page{$PageNum}" width="27" height="27" alt="page{$PageNum}" /></span></a> | |
31 | <% end_if %> | |
32 | <% end_control %> | |
33 | <% if PortfolioItems.NextLink %> | |
34 | <a href="$PortfolioItems.NextLink"><span><img src="/themes/XX/images/buttons/next_off.png" id="next" width="27" height="27" alt="next" /></span></a> | |
35 | <% end_if %> | |
36 | </div> | |
37 | <% end_if %> |