• Hi,

    I have recently installed the contact form 7 editing extension. Works very well. I am trying to make some mid-level admin pages using the built-in [cfdb-datatable] shortcode. The tables on such a page would only show a handful of columns (first_name,last_name,email). I would like the admin user to be able to click on the row’s entry to be able to view/edit the full record, like you can in the main admin controls.

    Is there a way to assign a column(s) to be a link to the full record, where then they can modify what is not presented in the [cfdb-datatable] page?

    Thanks,

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • I don’t use the editing exstension but I did do what you asked. What I did was I created an unique field on the form and is defined as an “Increment Value Field”. This means that every time a new submission is added this field adds a value of “1” basically having a unique identifier. (I used caldera forms instead of Contact Form)I believe that submitted time can be used as that field. With caldera forms I can pass parameters with no coding. Anyway, since I dont have the editing extension (because I don’t want the user to edit it, just to see it) this is how I do it.

    [cfdb-datatable (with headers filters etc..)
    After that short code the following code (using text on the page) instead of “visual mode”:

    $('td[title="WhateverUniqueRecordIdentifierYouHave"] div').each(
        function () {
          $(this).html('<a class="modal-link" href="https://yourwebsite/yourpage/?parametervalue=' + $(this).html() + '">' + 'See Detail...</a>');
        })
    })(jQuery);
    </script>

    That code will display a column as a clickable link on the table.
    Line 1. The field that stores the unique record identifier.
    Line 3. The class “modal-link” I use it because, instead of opening another page, that shortcode used in conjunction with “WP Post Popup” plugin, will open any page or post as a pop up. So I point it to another page on which I have another [cfdb-datatable] shortcode (in your case I guess that you would use the premium shortcode that gives you the ability to edit the table). What this part of the address /?parametervalue=’ does is asign whatever field is rendered as a clickable link as a parameter for the other page. The part that says “See Details…” is what is shown on the text of the link istead of the actual value. So basically when the users click on that a page opens up with that parameter and on that page I have a shortcode of [cfdb-datatable] that uses a filter with filter=”ParameterField”=$_GETparametervalue)”

    I did that and use it as a master/detail way of seeing the submisions. Anyway sounds kind of confusing but it’s really not that difficult. Anyway I did it using this as a base and changed the code to fit my needs. I suggest to read it, even the comments because is valuable information there. Help Here. ** Note on that link I tried the part that says

    New in version 2.8

    Shortcodes in version 2.8+ allow you to add additional text before and after the short code. Include the above script with the short code like this (in between markers {{AFTER}} and {{/AFTER):
    with no luck. I just put the code after the shortcode and works great. Hope this helps in any way.

    • This reply was modified 6 years, 7 months ago by alaguna.
Viewing 1 replies (of 1 total)
  • The topic ‘Shortcodes – Create a link to the full record’ is closed to new replies.