Best way to implement an application in Wordpress

Joined
Mar 15, 2018
Messages
53
Likes
10
Degree
0
I want to build an application for one of my Wordpress sites.

It's supposed to be some sort of interactive comparison table, which lets you pick the items as well as the stats you want to compare. It will need quite a bit of data as I am planning for 100+ different items with 10+ different stats each.

It's probably easy to build in JS but what's the best way to implement it into my Wordpress page? Should I store the tool and the data on a different server and implement it with iFrame or something? Maybe a script?

What would you guys recommend?
 
what's the best way to implement it into my Wordpress page?
Why does it have to integrate with your Wordpress? Is there something needed that's only available by accessing the Wordpress data?
 
I'd probably create a JSON file to store all the products and details, and call it from an inline script where I can specify which items to yank out of the file and display. This way, when you go to create the table on the next page, you can copy and paste the inline script and adjust which products will show on that page.

Alternately you could not inline the scripts and place them all in separate files. Then you could either write an if-loop for the footer to call the right one based on which page is loading at the time. Or you could enqueue them all in the functions.php with if-loops there so they auto-load on the right page.

I wouldn't iFrame anything, especially if it will have affiliate links in it. That can throw off tracking and is against a lot of programs rules for that reason and others already.
 
Why does it have to integrate with your Wordpress? Is there something needed that's only available by accessing the Wordpress data?

No not really. Maybe I worded that wrong. I just need this tool to be on a Wordpress page.

I'd probably create a JSON file to store all the products and details, and call it from an inline script where I can specify which items to yank out of the file and display. This way, when you go to create the table on the next page, you can copy and paste the inline script and adjust which products will show on that page.

Alternately you could not inline the scripts and place them all in separate files. Then you could either write an if-loop for the footer to call the right one based on which page is loading at the time. Or you could enqueue them all in the functions.php with if-loops there so they auto-load on the right page.

I wouldn't iFrame anything, especially if it will have affiliate links in it. That can throw off tracking and is against a lot of programs rules for that reason and others already.

Thanks for the input. It's going to be an informational tool without affiliate links, what other reasons are there not to use iFrame?

The user has to be able to add and remove items on-page without reloading the page. He can also add and remove columns for different data.

This might be a good example: https://www.chromebookchart.com/#

In my case the user will be able to add and remove data points like Processor or Octane, while at the same time the table will start out blank and he can choose out of a list of Items like in this case different Chromebooks, to add to it.
 
The user has to be able to add and remove items on-page without reloading the page.

I was going to say AJAX for the "without reloading the page" aspect but it sounds like this will only appear on a single page and not separate sets of items on separate and multiple pages. jQuery would be an easy route if it's all of the data on one page, and Wordpress is already enqueuing jQuery and jQuery Migrate.
 
Would be simple to implement with something like vuejs or ember.
 
I have made a few WP sites where I add custom fields, but it can be a pain in the ass to also add the jquery/filtering using Ajax in WP, from my experience. I guess you can use the WP json api too, all though I haven't tested with that.

In those cases, I've added custom fields for i.e. price, and you can filter on the WP query object.

I'm launching a new batch of sites now, and won't be using WP. It makes it a lot easier.
 
Back