Friday, December 30, 2022
HomeWordPress Developmentdatabase - Show customized knowledge based mostly on URL slug

database – Show customized knowledge based mostly on URL slug


I’ve a seemingly trivial query on methods to show customized knowledge from an (exterior) database based mostly on the URL slug. I really feel like there have to be a plugin for this, however I can not seem to discover something.

What I need

I need to populate my web page with dynamic knowledge from a database based mostly on the URL the consumer visits, eg: mysite.com/house/companyX ought to show the house web page the place some components (some headings and many others) are crammed in with customized knowledge (principally textual content). I need to retrieve this knowledge from a database utilizing the URL slug (equivalent to “companyX”).

Ideally, I need to use easy components in my elementor web page to point which components have to be populated with the info from my database (eg a shortcode).

The database might be both exterior or in WordPress in a roundabout way, there will likely be a number of hundred entries in there.

What I do now

I do understand how to do that utilizing Javascript to learn the URL (and redirect with a customized header parameter) after which manually inject all of the customized knowledge immediately within the HTML with JS, however this takes plenty of time to code for all fields, is error-prone, and is a grimy answer typically.

What I’ve discovered

I consider there have to be a plugin that helps with this. I appeared into ACF, however that does not appear to be targeted on this. I additionally checked Handlebars that enables me to simply populate HTML with customized knowledge, and whereas this works, it feels soiled and in addition creates some styling points.

Thanks

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments