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.

"Next/Previous Entry" - or is it current entry?

September 08, 2011 9:35pm

Subscribe [4]
  • #1 / Sep 08, 2011 9:35pm

    gString

    54 posts

    Hi.
    My code:

    {exp:channel:prev_entry channel="{_channel}"}
        <a href="http://{path=%27{_templateGroup}/{_singleEntry_template}%27}%22id=%22prev" title="Previous project: {projectName}">{title}</a>
    {/exp:channel:prev_entry}
    
    {exp:channel:next_entry channel="{_channel}"}
        <a href="http://{path=%27{_templateGroup}/{_singleEntry_template}%27}%22id=%22next" title="Next project: {projectName}">{title}</a>
    {/exp:channel:next_entry}

    My problem:
    While the links works fine, the text that should be generated from the next/previous entry is actually derived from the current entry (‘projectName’ and ‘title’ tags).
    Help, please.

  • #2 / Sep 09, 2011 10:41am

    Sue Crocker

    26054 posts

    Hi gString,

    Is there a reason you aren’t using the verbage found here:

    http://ellislab.com/expressionengine/user-guide/modules/channel/entry_linking.html

  • #3 / Sep 09, 2011 11:21am

    gString

    54 posts

    Hi Sue,
    I thought I was doing exactly that? Of course, I modified it to suit my needs - but other then that I think I’m following the program.
    I also want to emphasis that the links work well! I only have problem with the tags.
    Thanks.

  • #4 / Sep 12, 2011 2:54am

    John Henry Donovan

    12339 posts

    hi gString,

    While the links works fine, the text that should be generated from the next/previous entry is actually derived from the current entry (‘projectName’ and ‘title’ tags).

    make sure you haven’t nested those tags inside the Channel Entry tag. They need to be outside of it. Is this the case?

  • #5 / Sep 12, 2011 6:52am

    gString

    54 posts

    John,
    Thanks! That was the problem. You might want to add a line about it to the user guide.
    I have a few q., if you can spare the time:
    1. The code now have more channel access (”{exp:channel:entries"). Does this mean the server will do more DB queries, hence will cause a performance hit?
    2. Is there a way to have a local variables, but unlike 'Preload Text Replacements' will be process so that they can get DB data that can be used locally instead of channel entry?
    3. If it isn't too much to ask, would you please take a look into my topic at http://ellislab.com/forums/viewthread/198962/

    Thanks again. It was long wait but I got what I need. Pity it wasn’t mention in the user guide.

  • #6 / Sep 12, 2011 1:55pm

    Mark Bowen

    12637 posts

    Hi gString,

    John,
    Thanks! That was the problem.

    Glad John was able to get you sorted there.

    You might want to add a line about it to the user guide.

    I’ve just gone and added a note to the user guide now. Thank you for letting me know about that.

    I have a few q., if you can spare the time:
    1. The code now have more channel access (”{exp:channel:entries"). Does this mean the server will do more DB queries, hence will cause a performance hit?

    Database access requirements change from template to template and site to site. This is really down to how you code your pages and unless we were to check every one of your templates (which we don't do as support I'm afraid) then it's a very difficult thing to advise on. Just make sure that you make good use of the disable=”“ on any Channel Entries where-ever you can though. This can help a lot when you have more Entries tags on your page.

    2. Is there a way to have a local variables, but unlike ‘Preload Text Replacements’ will be process so that they can get DB data that can be used locally instead of channel entry?

    I’m not quite following what you are after here? Could you possibly give an example please?

    3. If it isn’t too much to ask, would you please take a look into my topic at http://ellislab.com/forums/viewthread/198962/

    Someone will look into that post as soon as it comes up in our support queue. There’s no need to cross post like that as it will get looked at in good time.

    Thanks,

    Mark

  • #7 / Sep 16, 2011 6:59pm

    gString

    54 posts

    Hi Mark,
    Sorry for the delay in responding.
    1. About DB access: Is there detailed and through guidelines somewhere, that I can read?
    BTW, I am aware of the “disable” feature. It is pity that you don’t have “enable” feature that would save a lot of typing in some cases.
    2. About my local variable: think about the page I’m working here. I have to request the same entry a few times in that template. If I could have a way to set a local object or array that I can get all the data into it once (one DB access) and when use it over and over to my heart content - that would be awesome. Such a thing would be useful in many cases, IMHO. You don’t have that option, by chance?
    3. got your message - no cross posting. But till now haven’t heard for no-one. That’s almost couple of weeks.

    Thanks again, and have a nice weekend.

  • #8 / Sep 19, 2011 12:20pm

    Mark Bowen

    12637 posts

    Hi gString,

    As your original tech support question is now answered I’m going to move this post down to the Community Help forums as your other questions are more related to how to work in ExpressionEngine and best practices.

    That said I’ll answer the questions as far as I can :

    1. About DB access: Is there detailed and through guidelines somewhere, that I can read?

    Nothing really concrete in respect to that but just ensure that you have really good use of the disable=”“ parameter wherever you can and try to use as few tags on the page as you can. Utilising the Admin > System Administration > Output and Debugging Preferences > Display Output Profiler option can help a lot of the time enabling you to see where large jumps of processing time happen on your template / page and so can help you fault find on your own a lot of the time.

    BTW, I am aware of the “disable” feature. It is pity that you don’t have “enable” feature that would save a lot of typing in some cases.

    Please feel free to add a Feature Request for that if you want.

    2. About my local variable: think about the page I’m working here. I have to request the same entry a few times in that template. If I could have a way to set a local object or array that I can get all the data into it once (one DB access) and when use it over and over to my heart content - that would be awesome. Such a thing would be useful in many cases, IMHO. You don’t have that option, by chance?

    There isn’t anything like that built in to ExpressionEngine but there are a few 3rd party add-ons which allow you to take information from say one Channel Entries tag and then re-utilise it on your page multiple times without having to place another Channel Entries tag in there again.

    There is one that I know of here - MX Jumper and I’m sure there are more on http://devot-ee.com if you perform a search over there.

    Hope that helps a bit.

    Thanks,

    Mark

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

ExpressionEngine News!

#eecms, #events, #releases