artifex404 / grav-plugin-instagram

Instagram is a simple plugin that includes Instagram feed to your Grav website.
MIT License
16 stars 12 forks source link

Page not found error with twig #5

Closed bbricker87 closed 6 years ago

bbricker87 commented 6 years ago

Great plugin! Worked very well after one change. I'm not sure if this is an issue with just me or not. I installed this plugin through the admin. I was getting a "page not found" error on this line {{ instagram_feed() }} in my twig file.

I ended up going into the instagram.php file in the plugin and changing line 84 from this

$url = 'https://api.instagram.com/v1/users/' . $config->get('feed_parameters.user_id') . '/media/recent/?access_token=' . $config->get('feed_parameters.access_token');

to this

$url = 'https://api.instagram.com/v1/users/self/media/recent/?access_token=' . $config->get('feed_parameters.access_token');

That's how I made the call on a Wordpress site I made a couple years back, and it still worked. The only thing is that the user_id doesn't matter using this method.

Just thought I would bring to attention if anyone else was dealing with issues with this.

artifex404 commented 6 years ago

Thanks Ben for reporting! Will give this change a try, and will implement if the user id is really not needed. You could contribute by making a pull request for this change.

artifex404 commented 6 years ago

Thanks for the pull request! Closing this issue.

julienvanderkluft commented 6 years ago

Hi,

I had the same error after installing the plugin via Grav CLI, and this fix still works. But package doesn't look updated 🤔

Anyway, thanks for this plugin.

artifex404 commented 6 years ago

@julienvanderkluft Made the release. This fix should be soon available through Grav CLI.

julienvanderkluft commented 6 years ago

@artifex404 Updated, works well 👍

artifex404 commented 6 years ago

Great stuff. Thanks for reporting!