ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Only showing the entry on the first page of comments

August 27, 2012 5:19am

Subscribe [1]
  • #1 / Aug 27, 2012 5:19am

    APGWest

    295 posts

    This would seem so simple but it’s baffling me…

    I want to show an entry along with comments but when you click on the pagination links to any page other than page 1 of comments, I DON’T want it to show the entry, just the appropriate comments.  Please tell me this is easy and I’m just tired…

  • #2 / Aug 27, 2012 2:54pm

    Kevin Smith

    4784 posts

    Hi Don,

    There’s not a setting or parameter to make this happen, but I can think of a few different ways to accomplish this, all depending on how your template is set up. Could you share the code you’re using to display the entry and its comments?

  • #3 / Aug 27, 2012 3:19pm

    APGWest

    295 posts

    I don’t have a template setup yet.  I was just contemplating on how to achieve it.  What are your ideas?

  • #4 / Aug 27, 2012 4:06pm

    Kevin Smith

    4784 posts

    If it were me, I’d want to use CSS to hide the entry but still have it loaded on the page so that a user could view it if they wanted to see it (for context as they read the comments). I’d use a PHP-based conditional that looks to see whether or not a pagination “P” is in the URI string (in whichever segment it would be in given how I have the template set up) to determine whether or not to include

    style="display:none;"

    in the div that surrounds the channel entry. That way I could then use some JavaScript and a link to allow viewers to toggle the entry on or off.

    The conditional, if segment 3 is the one where the pagination “P##” might look like this.

    That’s just an overview. Obviously you could embellish it to your liking.

  • #5 / Aug 27, 2012 4:08pm

    APGWest

    295 posts

    I never thought of shutting it off via CSS!  I like how, using javascript, I could have it there as well for reference for them.  Thanks for that!

  • #6 / Aug 27, 2012 4:09pm

    Kevin Smith

    4784 posts

    Glad I could help! If anything else comes up, just holler.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases