mpshop Posted October 18, 2011 Share Posted October 18, 2011 I am having problems placing a function in the right TPL file, so its seen. I have tried using {literal} {/literal} however that still does not work. Any ideas; Thanks. I am trying to call a function to share on a facebook wall, see below; function streamPublish(name, description, hrefTitle, hrefLink, userPrompt){ FB.ui({ method : 'feed', message: userPrompt, link : hrefLink, caption: hrefTitle }); } function publishStream(){ streamPublish("myproduct", 'This product is cool ', 'test', 'http://www.w.net/w.html', "test"); } <div onClick="publishStream();" style="position:absolute;display: block; cursor:pointer; "> <img src="{$base_dir}themes/test/img/share.png"> </div> Link to comment Share on other sites More sharing options...
phrasespot Posted October 21, 2011 Share Posted October 21, 2011 Which TPL file do I need to place a function in ? That depends on where you want the snippet. Did you warp the JS in script tags something like <script type="text/javascript"> {literal} function streamPublish(name, description, hrefTitle, hrefLink, userPrompt){ FB.ui({ method : 'feed', message: userPrompt, link : hrefLink, caption: hrefTitle }); } function publishStream(){ streamPublish("myproduct", 'This product is cool ', 'test', 'http://www.w.net/w.html', "test"); } {/literal} <script> <div onClick="publishStream();" style="position:absolute;display: block; cursor:pointer; "> <img src="{$base_dir}themes/test/img/share.png"> </div> Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now