Closed ljubomirb closed 3 years ago
Do you have an URL to the page that's failing so I can have a look ?
I'm experiencing this in basic grav quark skeleton theme.
link to skeleton theme
You can, for the sake of test, download this entire folder, rename old grav folder as grav_old, place this as grav. Once you open (and possibly register again, including adding media type), simply add [3dv]test.ply[/3dv]
anywhere at subpage (module). It is not a matter of ply vs stl, I tried to test it. The result is "unknown error" text that appears at the top left. Everything else is there, box, controls...
But, if you add page (not module), with "default" type from home page, you can easily see it all work.
From your description, I think the issue is in the path to the model file (.ply
or .stl
) which is not deduced as expected. I don't have another server to install grav upon and I don't want to break my blog, that's why I've asked you a URL so I could test by myself.
Anyway, let's try to sort it out logically:
../
before or whatever). Please post the "good" URL here. It appears you are right, it has to do something with path. Great instructions!
So, in case of this default theme (skeleton grav quark), any access to file goes OK if files are in home page (here), but fail if files are at their module pages in this case "highlights", "callout" or such, no matter where the placeholder is (in any child module page). So download link looks always like: <domain>/grav/some_homepage/test.ply,
where in my case <domain>/some_homepage/test.ply
in production scenario.
In conclusion, I can live with having files in home location, but if you think this is something to be changed, here it is. I hope I helped.
There's something that's not clear in Grav: handling of URL. I've tried on different "mode", with multi language site and without, yet, there's always something wrong going on. Right now, I'm using the slug()
method that should be the swissknife of URL, but it does not seem to work for you.
Can I ask you to modify a file and post the output (send it by email if you want):
In V3DShortCode.php, the lines that looks like this:
class V3DShortcode extends Shortcode
{
public function init()
{
$this->shortcode->getHandlers()->add('3dv', function(ShortcodeInterface $sc) {
$this->shortcode->addAssets('css', 'plugin://viewer3d/assets/css/3dviewer.css');
$this->shortcode->addAssets('js', 'plugin://viewer3d/assets/js/three.min.js');
$this->shortcode->addAssets('js', 'plugin://viewer3d/assets/js/o3dv.min.js');
$this->shortcode->addAssets('js', 'plugin://viewer3d/assets/js/3dviewer.js');
$slug = $this->grav['page']->slug();
can you add this just below so it looks like this:
class V3DShortcode extends Shortcode
{
public function init()
{
$this->shortcode->getHandlers()->add('3dv', function(ShortcodeInterface $sc) {
$this->shortcode->addAssets('css', 'plugin://viewer3d/assets/css/3dviewer.css');
$this->shortcode->addAssets('js', 'plugin://viewer3d/assets/js/three.min.js');
$this->shortcode->addAssets('js', 'plugin://viewer3d/assets/js/o3dv.min.js');
$this->shortcode->addAssets('js', 'plugin://viewer3d/assets/js/3dviewer.js');
$slug = $this->grav['page']->slug();
dump($this->grav['page']);
var_dump($this->grav['page']->getMediaUri());
var_dump($this->grav['page']->url(false, true, true, true, false));
This will add some glibberish on the top of the page using the plugin, please copy and paste here or send it to my email address.
Meanwhile, you can workaround this bug by using ../../../some_homepage/test.ply
instead of the simpler test.ply
.
Can you provide me some email or point me how to otherwise send private message to you. Because, I was thinking of paying you one month of server droplet on digital ocean to play with. It's at least what I can do to help you, and because, honestly, I have limited knowledge in grav and frontend design anyway. What do you think about it?
We changed email, thanks. You can send me the logs of the change above, I'm confident it's not a hard to fix bug.
After discussion, I think this issue is resolved. Feel free to re-open if you don't think it is. Cheers!
I'm having trouble having plugin to work in basic quark skeleton when I add in module text/hero/features. The only way it works is if it is in new page. Maybe something is missing, maybe something needs to be inherited? The placeholder shows, all controls show, but "unknown error" appears.