Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author xnau webdesign

    (@xnau)

    waxsolutions,

    The [pdb_record] shortcode is used to access an editable record with a private ID. Do you want a user to have access to a series of records that they can edit?

    Now, if you want to have a “next” button for the [pdb_single] shortcode, that might make more sense, but still, what is it that determines the sequence? What would you expect the “next” record to be?

    Thread Starter Johann

    (@waxsolutions)

    Hi Roland,

    Thank you for your prompt reply.
    I m using your plugin as a database reader and the people who are using it need to be able to go to the next or previous record when they are on the [pdb_record] or [pdb_single] instead of going back to the main [pdb_list].

    I could I achieve this with a simple next & previous buttons?

    thank you

    Plugin Author xnau webdesign

    (@xnau)

    waxsolutions,

    OK, so you want to use the [pdb_single] shortcode, not the [pdb_record] shortcode, right?

    Also, you didn’t anser my question about the sequence. What is the sequence you are looking for? The date it was created? When it was updated? Some other value?

    Thread Starter Johann

    (@waxsolutions)

    I want to use both with the next and previous button.
    I will put the code on my template for the [pdb_single] or [pdb_record].
    well I want the id to be the sequence (not the date or private_id).

    example:
    on the [pdb_record] mode:
    if you are on the record id=100
    when you press next it goes to the record id=101
    if you press previous it goes to the record id=99

    the same thing if I am on the [pdb_single] mode.

    I hope that I make more sense now…

    Thank you for your quick replies.

    Plugin Author xnau webdesign

    (@xnau)

    OK, you will have to add this to the template:

    <?php
      $next = preg_replace('#(pdb=)(\d+)#',"\${1}".($this->participant_id +1),$_SERVER['REQUEST_URI']);
      $prev = preg_replace('#(pdb=)(\d+)#',"\${1}".($this->participant_id -1),$_SERVER['REQUEST_URI']);
      ?>
      <p><a href="<?php echo $prev ?>">previous</a> <a href="<?php echo $next ?>">next</a></p>

    You’ll probably want to style the links differently, but you get the idea. Also, this is a bit of a hack because it doesn’t know if the next record doesn’t exist.

    Thread Starter Johann

    (@waxsolutions)

    Thank you very much for your help.
    I will try that and let you know.

    Thanks

    Thread Starter Johann

    (@waxsolutions)

    Good morning

    Thanks again, It works perfectly on the [pdb_single] but not on the [pdb_record] for some reason.

    Would it be because the private_id is not in a sequence?

    Any idea how to fix this?
    if not, thanks for trying. I will still use the pagination on the [pdb_single]

    Have a great day.

    Thread Starter Johann

    (@waxsolutions)

    I made a small donation…
    Keep the good work.

    Plugin Author xnau webdesign

    (@xnau)

    Yes, this won’t work on the [pdb_record] shortcode.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Next & Previous button on Record page’ is closed to new replies.