• Resolved jeezyo

    (@jeezyo)


    Im trying to wrap my mind around how i can display single items, using only php. I created a custom page template which i can select and works great to display pages with multiple listings, and while i have a similar template set up for single items, im not sure i understand how i would trigger that for virtual posts. Any way you might point me in the right direction? I currently have the single items set up through the virtual post admin — which works great, but im really trying to take that entire step out of the equation and let it all happen automatically, or at least, without having to do much more than create a new page. I should add, that ive got pages displaying custom meta boxes where i can enter in the connection/table/view, so i would basically just pass those values through to the query. I’ve seen in the plugin description that all features can be achieved purely with php, so im sure there is a way — and i just dont know it ?? Any help is greatly appreciated!

    • This topic was modified 6 years, 1 month ago by jeezyo.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Chester McLaughlin

    (@chetmac)

    VirtualFields are meant to supplement ACTUAL posts/pages with Airtable data.

    VirtualPosts are meant to use a single template to display any number of single records from an Airtable base.

    The $post->AirpressCollection is an array even when only one record is returned, so you’ll always (in PHP) need to eventually do:

    $record = $post->AirpressCollection[0] in order to do $record["Name"]

    … I’m not sure I fully understood or answered your question, so let me know and I’ll try again.

    Thread Starter jeezyo

    (@jeezyo)

    ok, so i think my low level php skills are going to be why it may be a bit hard for me to explain, so bare with me ?? From what i can tell, it is virtual posts that i need to use. Im essentially generating a shop, from airtable views. So ive set up a template that displays a grid view of all the products. In the wordpress admin, ive set custom meta boxes for pages so that for each page i can choose an airpres connection/airtable view/airtable table which are then passed into the query in the template. This way there is a real page where i can customize my seo for that grid page, and other theme specific page attributes. and then when you click on one product, it should take you to the individual product virtual post. Similar to your restaurants example, in your video (but that was shortcodes). But as it stands, in order to show those single products, i still need to set up the “item” virtual posts in the airpress admin — ive created the query for these single virtual posts in php, but im a bit lost as to how i would trigger them. Where the airpress admin, i think, uses the — url pattern + map to this page — to know what to display. I’m trying to cut the airpress admin part out of the equation and have it all running via php and meta boxes, as a few of the people im working with on this project will likely not be able to manage the url patterns and such. I hope that makes more sense! I had actually messaged you last week, would love to (pay you) to chat for a bit and make sure im doing this all right ??

    Plugin Author Chester McLaughlin

    (@chetmac)

    Sorry I missed your earlier message. Go ahead and send me a message via https://chetmac.com/contact/ with your contact info and we’ll setup a time to connect for a screenshare and we can walk through your setup.

    Thread Starter jeezyo

    (@jeezyo)

    No worries, i miss 1 out of 5 emails ?? I really appreciate that, going to send you a message now!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Single Item Virtual Posts with PHP Only’ is closed to new replies.