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.

I know this should be easy...so someone put me out of my misery please.

March 09, 2011 1:45am

Subscribe [2]
  • #1 / Mar 09, 2011 1:45am

    akrantz

    38 posts

    I know this should be easy and maybe I am just tired but I am having a heck of a time figuring this out.

    The scenario I am trying to create is:

    A blog with one article per page and pagination to view additional articles - Got that part figured out

    A sidebar with a list of recent articles I have written - I think i have this figured out

    What I want to happen:

    When a user clicks an article in the sidebar they are taken to that article. This should appear the same way other articles appear as a single entry on the page with pagination to view additional articles and a sidebar of additional recent posts. This page is essentially identical to the one they jsut came from with the exception that the article they are viewing has changed.

    The way I have things set up now they ALMOST work….

    Currently, when a user clicks on an article in the sidebar it takes them to a page that shows them the article they clicked on. check.

    however….the sidebar no longer works….the pagination no longer works….

    More specifically. The sidebar now ONLY displays the entry they clicked on and none of the other recent entries.

    And the pagination has vanished…

    Anyway I can certainly paste code if anyone is interested although have fiddled with it so much I don’t even know what the last thing I tried is.
    I guess what I am wondering first is: What strategy should I employ in creating this scenario?

    Should I use Categories? related_entries? The articles are not related in any particular way other than that they are all from the same channel.

    I know this must be a very typical need and I see it all the time. What is the most common approach to working this out?

    My apologies if this is a newbie question.

    Thanks in advance for any help
    -A

  • #2 / Mar 09, 2011 2:00am

    Cheif

    626 posts

    In the side bar code, try using the tag dynamic=“no” in your {exp:channel .... dynamic="no"}

  • #3 / Mar 09, 2011 2:06am

    akrantz

    38 posts

    Hey thanks! that totally works to solve the sidebar problem. The pagination disappearing on the single entry page is still an issue though.

    The functionality should remain the same for the linked sidebar pages, so all that is changing when a user clicks a sidebar link is the order of display, where the linked article is now the first displayed article and the others are paginated. Does that make sense?

    I am currently using {title_permalink='blog'} in the href tags for the sidebar. Not sure if that has something to do with it.

    Thanks again
    -A

  • #4 / Mar 09, 2011 2:12am

    Cheif

    626 posts

    No it doesn’t make sense but it’s late in the day here 😊

    What code are you using to display pagination on the single entry page ? (simple code pls). In fact, why are you using pagination at all ? Pagination is generally used on summary pages (IMO). And finally, the order of the sidebar links is another story 😛

  • #5 / Mar 09, 2011 2:16am

    akrantz

    38 posts

    Yeah late here too. Such is the life of a developer I guess.

    Pagination code is as follows:

    {paginate}
            {if {total_pages} > 1}
            <div class="spinner">
                {if previous_page}<a href="http://{auto_path}" title="Show previous page" class="previous_image" target="_self" rel="noopener">Prev</a>{/if}
                {if next_page}<a href="http://{auto_path}" title="Show next page" class="next_image" target="_self" rel="noopener">Next</a>{/if}
            </div>
            {/if}
    {/paginate}

    And I will forgo the usability debate concerning the altruistic purpose of pagination in general, except to say that I feel its nice for a user to be able to hit a a single link and page through articles. Adding pagination allows them to click “next” and view the next article.

    Thanks again for all the help.
    -Aaron

  • #6 / Mar 09, 2011 2:24am

    Cheif

    626 posts

    WHat happens if u remove the {} around total_pages ?

  • #7 / Mar 09, 2011 2:29am

    akrantz

    38 posts

    nothing :(

  • #8 / Mar 09, 2011 9:09am

    Naveed123

    1 posts

    hi guys , I am a simply online buyer and save my precious time online store and online jeweler store is a main key to shop at home. Online shopping store is a most familiar in all over the world at avs platform. Online seller and buyers are available here all the time; every body can visit it at onlineshoppingavs For webmasters it is a great way to place links, and share ideas of online shopping store, shopping store, and online store.

  • #9 / Mar 09, 2011 10:45am

    anoopbal

    152 posts

    Try adding paginate=“bottom” to your entry tag in your side bar.

  • #10 / Mar 15, 2011 5:40pm

    Abogados Miami

    4 posts

    I have had the same problem, I am newbie, but here my doubts cleared it and try and test the suggestions, thanks.
    Greetings ...

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

ExpressionEngine News!

#eecms, #events, #releases