Jump to content

Search the Community

Showing results for tags 'Pagination'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to ProcessWire
    • News & Announcements
    • Showcase
    • Wishlist & Roadmap
  • Community Support
    • Getting Started
    • Tutorials
    • FAQs
    • General Support
    • API & Templates
    • Modules/Plugins
    • Themes and Profiles
    • Multi-Language Support
    • Security
    • Jobs
  • Off Topic
    • Pub
    • Dev Talk

Product Groups

  • Form Builder
  • ProFields
  • ProCache
  • ProMailer
  • Login Register Pro
  • ProDrafts
  • ListerPro
  • ProDevTools
  • Likes
  • Custom Development

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

  1. Hello, I want to paginate my keyword = value pages. This works well when I only paginate those pages: $fonts = $pages->get("/fonts/") But it stops working when I try to paginate $fonts = $pages->get("/fonts/")->find("keywords=mykeyword"); My pagination code looks like: $fontlist = $fonts->find("id>1, limit=6, draft=0, sort=-created"); $pagination = $fontlist->renderPager(array( 'nextItemLabel' => "▶", 'previousItemLabel' => "◀", 'linkMarkup' => "<a rel='prefetch' href='{url}'>{out}</a>")); echo $input->pageNum; foreach($fontlist as $font){ … “Allow page number” is checked on both fonts ant keywords templates.
  2. Hello developers, I am a newbie to Processwire CMS or CMF. I am stuck in using the TextFormatter module. I need to have pagination for a page, but this page has a header with a 1022*1024 image, so when click on next page, I get the repeated header image. Is there a way to remove the header image on clicking next.
  3. Hi guys, I just found out about Page Table module, which i'm currently using as a replacement for repeater module. Is there any way I can add pagination, and numbering for better and easier administration. Thanks
  4. Hello, since this is my first post in the General Forum I want to take the chance to say thank you for Processwire. I really like what all of you have done so far and it makes backend development fun again . Now to the main topic. I attached a screenshot of how my paging is rendered, using the Pagination module. The issue is the spacing between my li tags. I want to achieve a 1px margin between them. Right now they are inline block with margin set to 0. Still I get the spacing. So the problem must be that the html which is rendered by the module is "pretty printed" So after each li there is a line break and some tabs. The space is actually is a "text space" if u will, an therefore now chance for me to get rid auf that space with css. Any tips on how to get around that? Cheers
  5. Hi Guys, I have a trouble with building PageArray. Actually I am running the selector on a log when an article is read. The template=history , with article field links to article template . When a user reads an article I log to history the time article read. Think something similar to facebook history . Now I am trying to get the history back. So what I am doing is $articles_history = $pages->find("template=history, limit=3"); $articles = new PageArray(); $articles->setLimit($limit); $articles->setTotal($articles_history->getTotal()); $start = ($input->pageNum - 1) * $limit; $articles->setStart($start); foreach ($articles_history as $article_history) { $articles->add($article_history->article); } $pagination = $articles->renderPager(array( 'currentItemClass' => 'active', 'listMarkup' => "<ul class='pagination'>{out}</ul>", 'itemMarkup' => "<li class='{class}'>{out}</li>", 'linkMarkup' => "<a href='{url}'><span>{out}</span></a>", 'separatorItemLabel' => "<span>…</span>" )); echo $pagination; There are a few troubles though when the article is same. The PageArray will add only once, and no more duplicates are added. That is one trouble. Now the actual trouble is the correct pagination is not coming. I wonder whether it is due to this reason. There is only total 10 articles with 2 being duplicates. I added a limit of 3. Then the pagination on first shows me 1, 2, 3, 4, 5. Not sure why though. Is there a way to fix this ? If you have thought of using the $articles_history then I could not because the templates are required :-/ and being used by other places. Something like partials. Thank you
  6. Hi guys, am I doing something wrong? I get this selector $appuntamenti_privati = $pages->find("template=appuntamento_privato|appuntamento_cinema|appuntamento_cultura|appuntamento_gusto, start=11, limit=10, sort=-date, sort=title"); and then i get this at the end of the page <?php echo $appuntamenti_privati->renderPager(); ?> and i get a pagination rendered but it doesn't work correctly. I have only and always the "Prev"and it's always linked to page2 and, above all, every page shows always the same results (the first ten results). I can't get were the problem is. Thanks!
  7. Hello, I've seen some code on the forum, but it doesn't seem to work for me, or I'm using it wrong. I'm after a simple way to find out how many pages there are for a certain pagination, or the last page number. Thanks.
  8. Hi guys, I have worked with pagination multiple times but seem to be having major issues as it is not showing at all. I have installed the module and selected page segments and allow page numbers within the template but still no joy. My structure is as follows; News Year Month Story My code is as follows on the news page. <?php $parent = $page->parent; $children = $page->children; $results = $page->find("template=news_story, limit=3, sort=-story_date"); $pagination = $results->renderPager(); ?> <?php foreach ($results as $child) { echo "<article><div class='blog-media banner-blog'> "; foreach($child->story_image as $images) { $images1 = $images->size(628, 227); echo "<img class='news-img' src='$images1->url' alt='{$image->description}'>"; } echo "<div class='tp-bannertimer tp-top'></div></div>"; echo "<h4><a href='$child->url'>$child->story_title</a></h4>"; echo "<ul class='no-bullet post-info'><li class='no-tag2'><i class='icon-clockalt-timealt'></i><span>$child->story_date</span></li></ul>"; echo "$child->story"; echo " <a href='$child->url' class='button small green'>Read More</a></article>"; } ?> <div class="pagination"> <?php echo $pagination; ?> </div> Any help would be greatly appreciated. Melissa
  9. Hi, trying to implemement a set of blog pages and started using the Pagination module to find I couldnt list the page=2 etc results. This is what I started with: This is on a blog template, of which the post template children have page number enabled. $results = $page->children()->find("limit=2, sort=-date"); $pagination = $results->renderPager(); echo $results->render(); This didnt produce different results when clicking 'next'. so I tried: $limit = 2; if($_GET["page"]==0){ $startNum = 1; }else{ $startNum = $_GET["page"]; } $start = ($startNum-1) * $limit; echo $start; $results = $page->children()->find("start=$start,limit=$limit, sort=-date"); $pagination = $results->renderPager(); echo $results->render(); And it works up to a point but then starts doing some crazy stuff! (like adding a new number for another list page which doesnt exist, e.g. page=4 when the limit only allows for 3 pages of list). any help would be amazing. b
  10. Hi Everyone. I need help to paginate search results generated from a search form. my search result url: http://mysite.com/search/?products=tshirt&size=xl how do I keep the value when generating pagination using MarkupPagerNav? like on SKyscrapers example: http://processwire.com/skyscrapers/search/page2?city=albuquerque (tried to look at the source code but can't find where Ryan set the pagination options, maybe I missed it? can someone point it out to me ) at the moment my pagination link only showing the page number without the get value i.e: http://mysite.com/search/page2 however, it showing correct results if I type the url manually like: http://mysite.com/search/page2?products=tshirt&size=xl I'm assuming I need to set the getVars in the pagination options can you give me example how to use the "getVars"? I've set the cache to 0 in the template setting. my code: $pagination = $matches->renderPager(array( 'nextItemLabel' => "»", 'previousItemLabel' => "«", 'listMarkup' => "<ul class='MarkupPagerNav pagination'>{out}</ul>", )); thank you!
  11. Is it possible to add pagination limit after merging to PageArrays? I'm querying pages for an event calendar where there are two conditions: Events that are starting in the future Events that started in the past but are ending in the future (aka are current) I've coded the following but I want to limit the results to trigger the pagination, but my code is not working. What can I do? $events = $pages->find("template=event, date>=today, sort=date"); $events = $events->append($pages->find("template=event, date<=today, date_end>=today,sort=date")); $events = $events->find("limit=15");
  12. I saw in a previous post (about a year ago) that pagination for repeaters was on the roadmap. Is this working yet or an eta? I'm hoping you'll chime in on this Ryan. Thanks! I'm currently working on a site where I have a repeater setup for a portfolio that filters the images by category. So in the repeater I have two fields (category - radio options, and image). But I also need to paginate through the images.
  13. today i use pagination found two questions and one is http://processwire.com/talk/topic/4751-sort-id-not-working/ and another question is the menu of all pages is missing. exclude first page. the menu code is wiritten in header.inc ,i use "include("./header.inc"); " get it. and this is the menu code: <?php $homepage = $pages->get("/"); $children = $homepage->children("limit=5"); $children->prepend($homepage); //index foreach($children as $child) { $class = $child === $page->rootParent ? " class='on'" : ''; $liclass=$child->numChildren(true) ? " class='hmp'" : ''; //get 2 menu //$finalstr=''; if($child->numChildren(true)) { $items=$child->children("limit=5"); $fstr="<div class='mc'> <ul>"; foreach($items as $item) { $fstr.="<li><a href='$item->url'>$item->title</a></li>"; } $fstr.=" </ul> <div class='ft'><b></b><i></i><div> </div></div> </div> "; } //end echo "<li$liclass><a$class href='{$child->url}'>{$child->title}</a>".$fstr."</li>"; } ?>
  14. Hi, I have a problem getting pagination working with urlSegments. I read the docs and the forum, and another issue comes up with sort of the same thing. The problem there was that baseUrl got set by options and was left empty, while in the code below, the baseUrl is first set by the module manager (or something deep down..) Anyhow, the problem is: my urlSegments wont get rendered in the link. I have the template setup correctly and the strange thing is, only the first part of the urlSegments shows up. Strange eh? All the others are added via $queryString I think because I added them to $input->whitelist(); But I'm not sure if this is necessary. Is it correct that normally, it would work out of the box because the urlSegments are part of the baseUrl? And, if I read the code in MarkupPageArray.module line 146, where the baseUrl is set by default, I read: if(empty($options['baseUrl'])) $pager->setBaseUrl($this->page->url . ($this->page->urlSegment ? $this->page->urlSegment . '/' : '')); This seems wrong and the reason only the first urlSegment gets added. Or, should $page->urlSegment contain all segments? And if it doesn't what could be the problem? (btw: maxUrlSegments=4, default)
  15. Full disclosure: I'm starting in ProcessWire after having used MODX almost exclusively for the last four or five years. I still tend to think in terms of the parameters that I can set in a function call and, frankly, my knowledge of php has degenerated thanks to every need pretty much being covered by the snippet library there. I am trying to familiarize myself with ProcessWire by coding a simple gallery site (to work my way up to more complex sites as I get more comfortable). I've been able to look up everything I need between the cheat sheet, wiki and the existing forum topics until today. I have finally stumbled into something I can't quite work out (and can't figure out keywords with which to search). Staging site, the gallery in question: http://www.creativejay.com/xine/portfolio/ (I haven't finished setting up fancybox, that's fiddly stuff for later) In the portfolio I have three albums currently. Since these galleries will only grow, I want to add pagination now. I understand how to paginate with MarkupPagerNav and find(), which is how I retrieve the albums themselves, but the individual images in the album are retrieved with a double scoop of foreach. Here's the entire code of my function at the moment: <?php function galleryMain(){ $albums = wire("pages")->find("has_parent=/albums/"); echo "<div class='albumgrid'>"; $out =""; foreach($albums as $album) { $albumimages = $album->gallery; $thumbsize = 140; foreach ($albumimages as $albumimage) { $out .= "<a href='{$albumimage->url}' title='{$albumimage->description}' class='fancybox-button' rel='fancybox-button'>"; $out .= "<img src='{$albumimage->size($thumbsize, $thumbsize)->url}' style='margin-right: 15px; margin-bottom:25px; border: solid 1px #000000;' height='{$thumbsize}' width='{$thumbsize}'>"; $out .= "</a>"; } echo $out; } echo "</div>"; } ?> So what's happening above (as I understand it) is that it's fetching the children of /albums/ which results in three albums. It runs through each one "as $album" and within that it runs through all the items in the album's $gallery field, then loops back and repeats for each album. If I add my pagination limit in the initial find() call, it's actually just limiting the number of albums display. Since my desired thumbnail limit is 30 per page and there are three albums this is moot (aside from not being what I want). If I were to limit within the "as $album" call, or deeper, would it not limit the items displayed from each album, but not necessarily result in pagination in the resulting web page that would lead me to additional pages of thumbnails? So my question is: What syntax (and where) do I use to paginate the code above to display a maximum of 30 gallery thumbnail images, total, from three albums per page? Ideally I'd also like to order them so that the newest images appear first, exclusive of what album they are from. I should note I'm following the gallery tutorial from the wiki and I am more than happy to use different code in my function entirely if it achieves the goal more directly. Thanks a bunch in advance!
  16. i've used "Example 3: Display a different language based on URL pre-segment" from the guide to make a site multi-language capable.. my language gateway looks like: <?php $user->language = $languages->get($page->name); $path = '/'; foreach($input->urlSegments as $segment) { $path .= $segment . '/'; } $mypage = $pages->get($path); if(!$mypage->id || !$mypage->viewable()) throw new Wire404Exception(); //replace local navigation links $out = $mypage->render(); $regex = '{(<a [^>]*href=["\']' . $config->urls->root .')(["\']'; $topnav = $page->parent->children(); foreach($topnav as $p) $regex .= "|" . $p->name; $regex .= ")}"; $out = preg_replace($regex, '$1' . $page->name . '/$2', $out); echo $out; the regex works quite well for everything else, but but kind of skews up on the 'blog/news' page which uses pagination. besides the fact that the pagination links end up as 'site.com/blog/blog/page2' instead of 'site.com/blog/page2', even when manually entering 'site.com/blog/page2', 4040 error is thrown. I'm guessing that things go bad here: $mypage = $pages->get($path); if(!$mypage->id || !$mypage->viewable()) throw new Wire404Exception(); since "path/to/page/page2" will not not return a page. Also, removing the "throw new 404" line, I end up with a blank page. Any suggestions? Thanks,
  17. I'm currently working on a site that includes a blog. Individual blog posts can be assigned multiple "categories" using a Page field type in the post that references pages using the "category" template. When I perform the following, the correct posts are displayed on each category page: $posts = $pages->find( "parent=/blog/, template=post, categories=$page->name, start=0, limit=20, sort=-date" ); But, when I modify the code to limit the number of posts that are displayed, the same two posts display on every paginated page within a category: $posts = $pages->find( "parent=/blog/, template=post, categories=$page->name, start=0, limit=2, sort=-date" ); My "category" template is set to "Allow Page Numbers" and the pagination is displaying on each paginated category page. But any posts beyond the first two never display. It has been a long working Sunday and I'm sure that whatever I'm doing wrong is silly, but I'm too tired to see it!
  18. Hi, I have the following code in a template that lists all the child pages of that parent. I'd like to include Pagination so it would only show the title of 2 child pages per 'page'. I have completed the process here http://processwire.com/api/modules/markup-pager-nav/ however, I'm now a little unsure how to integrate this into my code below. I tried the example code in that page but to no avail. Can someone explain or point me in the right direction? Here is my current code: <?php if($page->numChildren) { echo "<ul class='nav'>"; foreach($page->children as $child) { ?> <?php echo $child->title; ?> <?php } echo "</ul>"; } ?> Many thanks for any pointers
  19. Hey there. The pagination for my search isn’t working. I guess it has something to do with the merging of PageArrays beforehand. Take a look at the (simplified) search.php: $out = ""; if ( $q = $sanitizer->selectorValue( $input->get->q ) ) { $input->whitelist( "q", $q ); $pa = new PageArray(); $value = $pages->find( "title%=$q" ); $pa->import( $pages->find( "template=abc, …|…|…=$value" ) ); $pa->import( $pages->find( "template=abc, title%=$q" ) ); $result = $pa->find( "start=0, limit=4" ); $pagination = $result->renderPager(); $count = count( $pa ); if( $count ) { $out .= "<h2>Search results found</h2>"; $out .= "<ul>"; foreach( $result as $r ) { $out .= "<li>{$r->title}</li>"; } $out .= "</ul>"; $out .= $pagination; } else { $out .= "<h2>Sorry, no results were found</h2>"; } } else { $out .= "<h2>Please enter a search term in the search box</h2>"; } include("./head.inc"); echo $out; include("./foot.inc"); Pagination names are activated for the search template and the output of the pagination list is correct. When I go to "page2", "page3", etc. the result is always the very first 4 matches. Any help is appreciated, thanks! p.s.: I have to do the merging because one time I search for page references to a page (the "…" in the code) and one time for the title of a page with the template "abc". (offtopic: if you know a better solution to this just let me know)
  20. Hi, I am having problems controlling the pagination in ProcessWire. More specifically, how it displays the url. Normally, '/page2/' etc is appended to the url when using pagination. However, I am seeing all of my get vars (used for a search form) appended as well eg: '/page2/?dropdown_select_1=&dropdown_select_2='. I am using $input->whitelist facility to build a search form that exists on all pages on the site. I am not sure how to clear this specifically for the pagination url to look cleaner. My code fore the pagination is as follows: $pagination = $articles->renderPager( array( 'nextItemLabel' => 'next', 'previousItemLabel' => 'prev', 'listMarkup' => "<ul class='pagination'>{out}</ul>", 'itemMarkup' => "<li class='{class}'>{out}</li>", 'linkMarkup' => "<a href='{url}'><span>{out}</span></a>", 'currentItemClass' => 'current', 'getVars' => null ) ); As you can see, I have tried to use the 'getVars' property to (incorrectly it seems) clear the get variables. I'm using ProcessWire 2.2.9
  21. Does anyone know how to translate properly the words "Prev" and "Next" that are rendered with Processwire's paginator feature? Thanks!
  22. Hi everyone, Sometime since I posted something here, but I can't seem to be able to surpass this problem on my own. I've read a bunch of topics that relate to this problem but nevertheless, I fail to fix this pagination display. Let me explain and hope someone help me out. This is my current structure: Home CatalogCatalog (subpage, same type)Product 1 Product 2 ... Product N The script is triggered in the first 'Catalog' in the tree above. The template of this script is similar to the default search.php, where the results are packed into the $out variable and dumped at the end. I don't believe this has anything to do with my problem. At the beginning I have: $query = "limit=3"; $products = $page->get("name=produtos")->children($query); $count = count($products); It returns the correct number of items, and displays the first 3. At the end, I have the pager rendering: echo $jogadores->renderPager(); And it displays the correct number of pages. However, clicking one of the links, the page refreshes with a new URL, but with the same three results. The URL looks like this example for page 3: /path/to/url/page3 I have turned the "Allow Page Numbers?" on the 'catalog' template, so it should work. Thanks in advance!
  23. Hi. This code is not working. How can I render pagination in Modules? public function ___execute() { ...... $news_list = $this->pages->find('template=news-page,limit=1,sort=-created'); ...... $out .= $news_list->renderPager(); ...... }
  24. Hi there, Looking for advice around an approach to a requirement. I have the following existing page paths: Gallery -> Category ---------- /gallery/ladies/ Albums -> AlbumName ----- /albums/jane/ /gallery/ladies/ will list as many album entries that are categorised as 'ladies'. The template supports pagination numbering. The link to the 'jane' entry has been formed as follows: /gallery/ladies/jane/ - obviously, in addition to the template supporting pagination numbering, it also supports URL segments. Here is where I need some advice. The album page 'jane' is only a single page but, it has an images collection that may have, say, 30 images. I want to turn jane's images into 'Pages', say, two images per page. Therefore, there are 15 "pseudo-pages". However, PW pagination works against find()'s that return PageArrays whereas in my case, it won't actually find 15 physical pages. The desired outcome would be: /gallery/ladies/jane/ /gallery/ladies/jane/page2 /gallery/ladies/jane/page3 /gallery/ladies/jane/page4 ... Is this possible and if so, any suggestions how to approach this? Thanks!
  25. Hi there, Before Soma jumps all over me, I've searched through the many threads that involve pagination I've set things up as per the main Pagination article. When I click on the Next link, I get the existing page re-rendered. The URL at this stage says: http://localhost:888...re/news/?page=2 I'm not clear whether I should be checking the page number and only processing certain items in the find() or whether the find() internally observes the page number internally. It's worth pointing out the news is the parent page that summarises news items from a collection of child pages. Any ideas what might be going wrong here? Thanks.
×
×
  • Create New...