Jump to content

Hari KT

Members
  • Posts

    131
  • Joined

  • Last visited

Everything posted by Hari KT

  1. 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
  2. Actually I ran some issue on Pagination . I assume you don't need to pass the start value. When you pass start the pagination seems not working correctly at-least my end. PageArray do have slice method. see PageArray extends WireArray http://processwire.com/apigen/class-WireArray.html#_slice
  3. RT @LeaVerou: That feeling of bliss when all unit tests are passing :)

  4. RT @voidspace: Juju on digital ocean, one of the cheapest and fastest cloud providers. Happy orchestrating! http://t.co/tTEanTmf9H

  5. RT @ircmaxell: I've been leaning towards the conclusion that DRY is a dangerous thing to pursue. It tends to lead to weird decisions.

  6. RT @DanBangWTFRajib: .@harikt finally I found some use case of goto in PHP...... https://t.co/j9XchSatpg

  7. RT @pmjones: My Action-Domain-Responder video from #cft14 is now available at https://t.co/VfvRDPbZ1I -- enjoy!

  8. RT @yomilayer3: Thanks @pmjones for the awesome talk on ADR..it's a very interesting refinement of "MVC"..looking forward to trying it out …

  9. RT @pmjones: The ADR slides from #cft14 are now available at http://t.co/4X4zxWrcb7 -- I recorded the talk and will try to post it later.

  10. RT @pmjones: Action-Domain-Responder gets a nicer URL: http://t.co/cLrEZ6Hggz

  11. Thank you guys! I did as Soma mentioned removing all and adding back. That works with out much issues.
  12. RT @cordoval: #GushPHP @symfony @auraphp any companies interested in being trained on Gush team usage? is Open Source! http://t.co/UtgSGq5Q…

  13. And @taylorotwell you know to standardize something it will take years :D / cc @pmjones @cordoval

  14. Thanks guys! Will try out and mark as resolved.
  15. A few more installation of https://t.co/rbYlSk50kw will throw https://t.co/1YDVRZYWM7 back to 2nd position. #auraphp

  16. RT @nomadphp: Do you subscribe to our youtube channel?http://t.co/1YT8BIbHPqFree lightning talks! :)#php

  17. Hey diogo, Thank you for the reply. My problem is not at the front-end creating dragging stuff. My problem is at the backend how to make use of the PageArray to get sorted.
  18. Hi, I have add page field with categories to `user` template. In the processwire admin we can sort the page field items by dragging and moving the items. I would like to bring the same functionality to the front-end, so users can have a functionality to drag and drop. This can be saved via ajax rather than a save button. Would be helpful if anyone have done something like this. Thank you
  19. Updating @auraphp website with some slight changes http://t.co/plDOIMm0wM , and working on improving the book https://t.co/mwTpOM2M5C

  20. RT @rdohms: Nette tools are now off my list of things I may use.. Disservice to the community.

  21. if you have the time to create another standard, you could have applied to fig and fix the tab / space with http://t.co/OFmpz83UyD

  22. RT @symfony: FOSUserBundle: Entropy of generated tokens is lost http://t.co/TLTeMa5vwi

  23. RT @noaheverett: Thank you everyone who used @Twitpic & allowing me the honor of helping share your experiences. I will miss & cherish our …

  24. RT @thatpodcast: It is possible we recorded Episode 7 today.

×
×
  • Create New...