We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

Can you integrate Verge3D within a WP theme?

Home Forums General Questions Can you integrate Verge3D within a WP theme?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #40487
    Tristan Cross
    Customer

    Hi all,

    Apologies in advance if I get some of the terminology wrong here, and if there’s an extremely obvious answer I’ve missed!

    So I know you can integrate Verge3D as an iframe embed, but I wondered if it was possible to create a WordPress theme which can respond to interactions with a Verge3D application by calling specific pages?

    To try and explain further; I’m attempting to create a site where 50% of the screen always shows the Verge3D application and the other 50% is a site powered by WordPress. Interacting with certain 3D objects should be able to call pages on the WordPress half. (For instance, interacting with an object calls the ‘About’ page to be loaded.)

    Would the simplest way to achieve this be creating a static page for the Verge3D application and use the ‘add annotation’ puzzle to have WordPress appear as an ‘annotation’ in an iframe? This wouldn’t be the worst solution, but I’d quite like it to be possible for selecting something within WordPress to move the camera to the relevant object within Verge3D, which seems complicated by using iframes. I also realise it might be possible via one of the HTML puzzles, but I’m unsure as to how I’d retain the functionality of the WP backend doing this.

    I suppose I was wondering if it was maybe possible to have my Verge3D application load within the WP theme template I’m creating – for instance within the header.php file – and if so, what the best practice would be for this?

    Hope some of this made sense at least!

    Best,
    Stan

    #40534

    Hi Stan,
    The most straightforward method to achieve that would be creating custom page template from the Verge3D app’s main HTML. This way you won’t need to do any iframe tricks and your Puzzles logic will work out of the box. See nice article on how to do that here.

    Soft8Soft Tech Chief
    X | FB | LinkedIn

    #40739
    Tristan Cross
    Customer

    Thanks for getting back to me Alexander!

    I’ve been trying to go through articles like the above and following a few tutorials, and I think I’m halfway there. I’ve enqueued the js script files in WordPress’ functions.php file, but my browser returns the below “Unable to load the logic file: ‘visual_logic.js'” error.

    I’ve kept the file structure the same as the one V3D generates, and the other scripts are visible as having been correctly loaded when I inspect element, so I assume (possibly wrongly) that this is possibly due to it being called by this line in the main js file:

    var logicURL = params.logic ? params.logic : ‘__LOGIC__visual_logic.js’.replace(‘__LOGIC__’, ”);

    …in a way that WordPress doesn’t like?

    Any help and suggestions massively appreciated!

    Edit: to clarify, even though the error message is from a deployment on a local site, it replicates for me when tested on a live site, too.

    Attachments:
    You must be logged in to view attached files.
    #40840

    Hi,
    Indeed, the app tries to load visual_logic.js which is located in the same directory where HTML (or PHP) file located. Change ‘__LOGIC__visual_logic.js’ to the actual path to the logic script, say
    ‘__LOGIC__/actual/path/to/wordpress/scripts/visual_logic.js’

    Soft8Soft Tech Chief
    X | FB | LinkedIn

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.