2

I tried using instafeed.js from http://instafeedjs.com/ to show an instagram feed using a particular hashtag right before the footer on my homepage.

I added the file instafeed.min.js to my default/theme/js

I created a static block called instafeed with the content

<script type="text/javascript">
    var feed = new Instafeed({
        get: 'tagged',
        tagName: 'awesome',
        clientId: 'my client ID'
    });
    feed.run();
</script>

Then to the homepage layout xml I added

<block type="cms/block" name="instagram" after="previous block's name">
<action method="setBlockId"><block_id>instafeed</block_id></action>
</block>

Is this the correct way to integrate?

5
  • 3
    Did you try it?
    – Marius
    Sep 22, 2014 at 20:21
  • How does the file instafeed.min.js get included on the page? Sep 23, 2014 at 10:20
  • @Marius This is how it is set up
    – advsingh
    Sep 23, 2014 at 17:40
  • @clockworkgeek I'm sorry I forgot to mentio, I added to the layout xml <action method="addItem"><type>skin_js</type><name>instafeed.min.js</name></action>
    – advsingh
    Sep 23, 2014 at 17:40
  • How did you solve it? I'm with the same problem here..
    – user39830
    May 16, 2016 at 19:40

1 Answer 1

1

Is this the correct way to integrate?

Yes.

To clarify, you are using the right method because the script is only used on one page. If you wanted it to be included with every page then you could use the setting System > Configuration > Design > Footer > Miscellaneous HTML instead.

4
  • The problem is, its not working! I know it's not possible to debug from here. I'll just go over it all again myself, see if I've got anything wrong. Thank you for your help!
    – advsingh
    Sep 23, 2014 at 21:08
  • If it's not working that changes things. View the source of the page and check all appropriate parts are being output. Do not assume it's OK, prove it. The instafeed.min.js file and your block's content should be visible in the source. Sep 23, 2014 at 21:52
  • You were right, it was looking for instafeed.min.js in the base folder not the theme folder, I copied that over. I can see the block's contents before the footer too, but the feed still does not show up..
    – advsingh
    Sep 24, 2014 at 8:33
  • I cracked it! I was forgetting the <div>. I added that to the page and it works now. Thank you for your help!
    – advsingh
    Sep 24, 2014 at 8:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.