Jump to content

Chandini

Members
  • Posts

    6
  • Joined

  • Last visited

Everything posted by Chandini

  1. hi friends, I am trying to paginate the comments, below is my code $limit = 3; $start = ($input->pageNum-1) * $limit; $selector = "template=gallery, sort=-created, start=$start, limit=$limit"; $comments = FieldtypeComments::findComments("comments", $selector); print_r($comments); echo $comments->render(); if($input->pageNum > 1) echo "<a href='./page" . ($input->pageNum-1) . "'>Back</a> "; if(count($comments) > $limit) echo "<a href='./page" . ($input->pageNum+1) . "'>Next</a>"; this render the comments but there is no next page link showing. print_r shows there are 8 comments ProcessWire\CommentArray Object ( [count] => 3 [total] => 8 [start] => 0 [limit] => 3 [pager] => 1 to 3 of 8 [items] => Array ( [Comment:0] => 163 [Comment:1] => 162 [Comment:2] => 161 ) [extraData] => Array ( [selectors] => ProcessWire\Selectors Object ( [count] => 4 [items] => Array ( [SelectorEqual:0] => Array ( [field] => template [operator] => = [value] => gallery [string] => template=gallery ) [SelectorEqual:1] => Array ( [field] => sort [operator] => = [value] => -created [string] => sort=-created ) [SelectorEqual:2] => Array ( [field] => start [operator] => = [value] => 0 [string] => start=0 ) [SelectorEqual:3] => Array ( [field] => limit [operator] => = [value] => 3 [string] => limit=3 ) ) [string] => template=gallery, sort=-created, start=0, limit=3 ) ) ) please help Thank you NB : how to get the "featured" comments for a particular $page ? my earlier question
  2. how to get the "featured" comments for a particular $page
  3. thank you for your kind reply.. I am using the same code as above. but the problem is it will output all comments if the first page, then all comments of second page as like that.. this will not generate a output which is of the order of latest comments.. irrespective of the page of same template.
  4. is it possible to get the all comments in a particular template? irrespective to the page associated with the template.
  5. Actually I am loading all the pages to a pop window using the jquery script $(document).ready(function() { $(document).on("click", "ul.pagination li a", function(e) { e.preventDefault(); //var pageurl = $(this).attr("href"); $("div#loader").load($(this).attr("href"))}); }); what problem i face is when i submit a comment in a page, the url changes to some thing like http://localhost/myblogs/?comment_success=1#CommentPostNote so as result the page layout changes to the template layout of myblogs which doesn't include head and footer.. so how can i make sure the redirection url of the comment submission loads to the div id "loader" Your help is very much appreciated... thank you
  6. Actually I am loading all the pages to a pop window using the jquery script $(document).ready(function() { $(document).on("click", "ul.pagination li a", function(e) { e.preventDefault(); //var pageurl = $(this).attr("href"); $("div#loader").load($(this).attr("href"))}); }); what problem i face is when i submit a comment in a page, the url changes to some thing like http://localhost/myblogs/?comment_success=1#CommentPostNote so as result the page layout changes to the template layout of myblogs which doesn't include head and footer.. so how can i make sure the redirection url of the comment submission loads to the div id "loader" Your help is very much appreciated... thank you
×
×
  • Create New...