Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ajax based theme and plugin #60

Open
isuke01 opened this issue Mar 19, 2020 · 3 comments
Open

Ajax based theme and plugin #60

isuke01 opened this issue Mar 19, 2020 · 3 comments

Comments

@isuke01
Copy link

isuke01 commented Mar 19, 2020

Hello,
I have ajax/wp api based theme, and plugin wont work. I tried to run shortcode using custom endpoint with

	ob_start();
	echo do_shortcode("[vimeography cache='0' id='{$id}']");
	$vimeoFeed = ob_get_contents();
	ob_end_clean();
	ob_end_flush();

But it returns just
<div id=\"vimeography-gallery-2\" class=\"vimeography-theme-harvestone\" data-version=\"2.1\" itemscope itemtype=\"http://schema.org/VideoGallery\">\n <div id=\"subbie\">\n <gallery></gallery>\n </div>\n </div>\n

With no videos info, nothing I can call now on frontend, is there any way to load gallery using async function?

@davekiss
Copy link
Collaborator

@isuke01 Vimeography expects galleries mounting points to be available on pageload. You can see that the Vimeography Harvestone theme script will loop through the data available in the window and render to the appropriate mounting points:

https://github.com/davekiss/vimeography/blob/d25a3d8e79f05e9893924bee737bf18e8e7941a8/vimeography-harvestone/src/index.js#L56-L59

This data is all set up in the hydrate function of the Vimeography renderer:

https://github.com/davekiss/vimeography/blob/d25a3d8e79f05e9893924bee737bf18e8e7941a8/lib/renderer.php#L96-L129

You may be able to ensure this information is set on your AJAX page load and then manually add the Harvestone script to the page dynamically which would then trigger the rendering, but that functionality is not officially supported at this time.

@isuke01
Copy link
Author

isuke01 commented Mar 20, 2020

Thanks, for reply!

So looks like there is no way to fix it, since if user start on page A, there is not info about gallery that might be on page B or C ;/

@davidboll
Copy link

Hi @davekiss, a longtime customer here :) I having the same problem with a Wordpress theme that's ajax-based, the gallery won't load unless I manually refresh the page. Is there any workaround for this or any plan on implementing a version of Vimeography that will support ajax-based themes? I'd be willing to pay for an upgrade, no problem! Really love the plugin :) Thanks! /David

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants