Okay
  Public Ticket #1648534
Dynamic input URL
Closed

Comments

  • Amar started the conversation

    Hello, 

    We have tested your plugin at demo level, it was really nice, only issue we are facing it that there is a option to input URL, is there any way we can make this input URL dynamic and handle it through session or a variable from frontend. Here is a small example:
    We have data of two users in a json:

    ID: 1 Name: ABC Salary: 50,000

    ID:2 Name: XYZ Salary: 30,000


    What is want is that when ABC is logged in only data he can see will be its own data, same goes for XYZ. Please help me out with this.

    Thanks

  • [deleted] replied

    Hi Amar,
    Thank you for your inquire.

    Easiest way to achieve this would probably be with filters. If you are having ID column in that table which contains ID from the users you can set predefined filter value with placeholder %CURRENT_USER_ID%.This way when user log in to your website our plugin will populate filter with their ID and filter the table so they will see only the data from related to their ID. There is also a %CURRENT_USER_LOGIN% placeholder.

    For filtering trough URL please check - Documentation

     

  • Amar replied

    Thanks for your Quick response, I have another question i.e can we use multi-dimensional array? also can we us an API URL with basic AUTH returning data in JSON format. Please respond to my both questions

  • [deleted] replied

    Hi Amar,

    Please visit our Documentation to find out about limit for JSON format that our plugin could understand. If you have format that is different from one that our plugin needs you can write a PHP script that fetch the data from API and manipulate that data and return it in form of serialized PHP array. This way it will be easy to send request with AUTH.

    If you do have JSON in desirable format, we are using cURL to get data from URL so you can try to add username and password trough URL and if that doesn't work we can show you how to hardcode username and password in code.

    For testing purpose we have sandbox website where you can see and test all plugin functionalities

    sandbox.wpdatatables.com

    username: demo

    password: demo