blend4web background in wordpress

26 February 2016 01:02 #7750
Yes! Something like that, exactly. It's literally the first example I know of where the background on a wordpress site has been replaced with webgl.

I've just picked a random theme and slightly modified it. I've inserted the iframe right after the <body> tag, so it's rendered beneath other elements. It has also been required to adjust theme CSS to maximize the iframe onto the whole page.

But I still have no idea how to get that to work. My template even has a feature where if someone looks at it on their phone, it'll replace a video background with a static image, so if there was a way to just replace the video with the blend4web html, that would be great. That way mobile users would still get a photo instead.

I think this task needs some coding. You can check the user first (for example, just like the template does) and then decide what to do: run b4w application for desktop users or just show some background image for others. I don't familiar well with wordpress template system, but I think it can be a bit difficult in case of a nontrivial template.

"it’s not html, it’s base64 encoded into the template which could be a problem, since you now cannot change the way it works since everything is inlined you need someone to implement this in a correct way, else it’s gonna bite you in the ass sooner or later. if you put it in a page with contents/videos/images etc. it’s gonna behave differently, especially on for example an ipad inlined code means js/css IN the html page, instead of loading it"

That makes sense for a single html export, but b4w application can also be built as a project with separate resource files. Moreover, it's a recommended way for complex tasks.

To sum up, this is not a usual embedding and can highly depend on the template complexity. It may require to write a whole b4w application instead of using just a simple self-contained html file.
Blend4Web Team
26 February 2016 03:36 #7751
when you say "inserted the iframe right after the <body> tag", which page is this, the home page in the editor?
26 February 2016 10:54 #7765
when you say "inserted the iframe right after the <body> tag", which page is this, the home page in the editor?
I don't know about the home page. I've used the Atout theme. It has the "header.php" template file located at path: root/wp-content/themes/atout/header.php. This file is generally responsible for the opening part of a theme template. I've just found the <body> tag in it and inserted the iframe into.
Blend4Web Team
Please register or log in to leave a reply.