• Resolved arr0w

    (@arr0w)


    Is it possible to show a Private ID link on the pdb_list, like the admin page?

    I’m trying to make a custom list of editable users, which only logged in users can access (a private page)

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

    (@xnau)

    take a look at this tutorial:

    Adding an Edit Record Link to the Frontend List

    Thread Starter arr0w

    (@arr0w)

    Ah thank you!
    Exactly was I was looking for!

    How do I change the text for the link?
    Could the template set the href to “Edit” for each participant instead of the whole link?

    Thread Starter arr0w

    (@arr0w)

    Could I attach the private link to their names or usernames instead of making a new row?

    Plugin Author xnau webdesign

    (@xnau)

    You can place the link on any text field. On the line that has:

    if ($this->field->name == 'edit_link') {

    you can just change that to be the name of any field to place the link on that field.

    Thread Starter arr0w

    (@arr0w)

    Gotcha!

    When I use the pdb_list on mobile the last row (which we just created) are “sticking” out of the screen and only the “standard” fields are visible… I can scroll horisontal to see them, but the parent div doesn’t expand with them.

    any clue?

    Plugin Author xnau webdesign

    (@xnau)

    This has to do with the “overflow” property of the containing div, also whatever the width setting is for the containers inside it. It can be a little conplex determining what is cotrolling the width, but typically with mobile displays, you’re setting the width of the outer container to 100% so it fits the width of the device screen. If there are elements with a wider width setting inside of that one, they will overflow according to the overflow setting of the container. You may need to adjust the width of the overflowing element so it stays inside the screen. Sometimes just removing the width is all you need to do.

    Thread Starter arr0w

    (@arr0w)

    How do I use this function with the responsive template?

    Plugin Author xnau webdesign

    (@xnau)

    I can’t answer this in a general way, it depends on the HTML you are using and what your theme is doing in this particular case. You need to look at the HTML and determine which element is causing the problem, then test your overflow and width settings to see what rules you need to include.

    Thread Starter arr0w

    (@arr0w)

    But why is it different with the responsive template?
    Your suggestion above worked with the bootstrap template and I have my field ready, I just need to put the link in it.

    Plugin Author xnau webdesign

    (@xnau)

    The responsive template uses completely different HTML, so the same CSS won’t work the same on it.

    Thread Starter arr0w

    (@arr0w)

    Hmm okay, that makes sense.
    I’m trying to make a mobile friendly list with this “edit” link mentioned above.
    If I use the bootstrap template the table will continue out of the screen area.
    I tried changing the overflow but it didn’t help.

    Do you have any suggestion to make the bootstrap template mobile friendly so I can implement the record link. Can the table orientation be changed from horizontal to vertical?

    Plugin Author xnau webdesign

    (@xnau)

    Tables mostly don’t work on mobile devices, they can’t collapse to a narrow screen, that’s why the responsive template doesn’t use them. With the responsive template, you can show tabulated data vertically or horizontally. It may take some work crafting the CSS to get it to look right, however.

    Thread Starter arr0w

    (@arr0w)

    I would like to use the responsive template, but how can I insert the “edit record” link as mentioned above?

    Plugin Author xnau webdesign

    (@xnau)

    It’s pretty much the same once you see the pattern, you just need to look out for the methods that set up the record and the field…so after $this->the_record() you put the code that sets up the record edit link:

    $record = new PDb_Template($this);

    then, after the field is set up, put the code that adds the link to the field…so after $this->the_field() and before the value gets printed with PDb_FormElement::get_field_value_display($this->field) you put

    if ($this->field->name == 'edit_link') {
       $this->field->link = $record->get_edit_link();
    }

    Just be sure to keep your PHP tags straight and you’ll be good.

    Thread Starter arr0w

    (@arr0w)

    So I tried inserting the `if ($this->field->name == ‘edit_link’) {
    $this->field->link = $record->get_edit_link();
    }both before and after theif ( $this->field->has_content() ) : ` but I cant get it to work. The page just shows a blank screen. Am I missing something?

Viewing 15 replies - 1 through 15 (of 20 total)
  • The topic ‘Private ID link on pdb_list’ is closed to new replies.