alan Posted September 2, 2016 Share Posted September 2, 2016 In case anyone else* (*so that would be the future me then, when I've forgotten o_O) wants to know how to do this, I worked it out, it's probably in the docs but for the life of me I could not find it (sorry doc writers). You have a hanna code called my_hanna_snippet and you want to output it from within a template, not from the Admin i/f. $hanna = $modules->get('TextformatterHannaCode'); echo $hanna->render("[[my_hanna_snippet]]"); Hope this helps someone/me in the future 9 1 Link to comment Share on other sites More sharing options...
szabesz Posted September 2, 2016 Share Posted September 2, 2016 1 hour ago, alan said: it's probably in the docs http://modules.processwire.com/modules/process-hanna-code/ Using Hanna Code from the API If you want to populate Hanna Code from the API, you can do so using the render() method, like this: $hanna = $modules->get('TextformatterHannaCode'); $page->body = $hanna->render($page->body); We can just provide the hanna code itself, if we want to, just as you do it in your example. BTW, are you sure you have never seen this in the docs? 2 Link to comment Share on other sites More sharing options...
alan Posted September 2, 2016 Author Share Posted September 2, 2016 1 hour ago, szabesz said: We can just provide the hanna code itself, if we want to, just as you do it in your example. BTW, are you sure you have never seen this in the docs? @szabesz I am pretty sure the docs don't say "We can just provide the hanna code itself", I saw that part of the docs and was looking for that exact type of phrase, but even though I couldn't find that, it was enough for my trial and error to work it out, so all's well that ends well 2 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