Okay
  Public Ticket #3569086
Shortcode
Closed

Comments

  • David started the conversation

    Is it possible to specify specific columns to display using shortcodes?

    For example, if I have wpdatatable with three columns named: One, Two and Three and table ID = 7. Using shortcode can I display only columns One and Two?

    Something like: [wpdatatable id=7 cols="One, Two"] 

    Thanks,

    David

  •  1,689
    Miloš replied

    Hi David,

    Firstly, I would like to sincerely apologize for the delayed response as we have been experiencing an unusually high number of tickets. I am sorry that it has taken longer than usual to respond to your concern and your patience is highly appreciated.

    -

    Sorry to disappoint you, but something like that is not possible with our built-in Features, to call specific Columns through the Shortcode.


    Please feel free to search on our suggestions page

     to see if someone may be already suggested this feature. If you can't see it, feel free to add your suggestion there,  and as more people vote, the feature will move higher on the priority list.

    You can certainly follow our changeLog page if you'd like ( it is also available in the plugin dashboard), where we state any changes/new features/bug fixes during updates;

    and our newsletter, so you're informed about new features, bug fixes, freebies, etc.

    -


    2. The only 'workaround' i can think of that is 'as close as possible' is if you use SQL based tables.

    Then you will be able to make Custom Queries that only call specific Columns.



    For example, you can have one main/master Manual table which will store all the data in the database.

    Then, you can check this table's MySQL Table name from the Editing tab in the back-end table settings,

    and you will be able to make multiple SQL tables that pulls data from the same "master table",

    and any editing you do on all these other SQL tables are going to be stored in the same table in the database,

    This will be my example table :

    3791094982.png

    Now, to make a new SQL Table from it,

    first, check in Editing Tab/MySQL table name for editing:

    6795720227.png

    in my example, the Manual table name is wp_wpdatatable_39,

    so i make a new SQL table that will pull data from it;

    and we can choose all columns like :

    SELECT * FROM Table_Name

    or just specific columns;

    we can also have completely different settings/filtering/sorting and limitations for front-end users on each table;

    and you can make multiple SQL Query tables that pull the same data from the "main table".

    SELECT  column_name1,
            column_name2,
            column_name3
    FROM table_name

    -

    In this example, if i want to limit to only show the "Company" column, and i will leave wdt_ID ( because we got to have row ID)  and userid ( if we want userID for limiting rows per currently logged user ID),

    when i hide those columns in the end, the front-end user will only see the "company" column.

    SELECT  wdt_ID,    
        userid,     
      company      
     FROM wp_wpdatatable_39
    4596672496.png

    Later, you can make another SQL Table that will show some other columns, have other filters and so on ( depending on what you need to achieve)...

    You can see my Video example here https://watch.screencastify.com/v/jOXrsJ9jaspWG5m3VqZH

    Let me know if that makes sense and if you have any questionssmile.png


    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables