thomas Posted November 20, 2012 Share Posted November 20, 2012 Hello, I'm trying to build a very simple Translator Plugin and somehow managed to get what I want on a "simple" page, meaning one that's straight from the admin. Now I'm trying to build the same functionality into my overview pages. The idea is to put the language into the session and then use $page->body or $page->body_en (and a few other fields) accordingly. Is there a way I can hook into $pages->find, iterate over the array, swap the content of the containing pages and return the array? For style and comfort I'd like to do this in a module, so a hook is needed. I tried addHookAfter('Pages::find,'','') but could make no sense out of it. I hope my explanation makes sense. Thanks for any hints, thomas Link to comment Share on other sites More sharing options...
thomas Posted November 20, 2012 Author Share Posted November 20, 2012 Got it. I'm slowly understanding the hooks Link to comment Share on other sites More sharing options...
ryan Posted November 20, 2012 Share Posted November 20, 2012 Do you mean you've got this figured out? Let me know if I can post an example of hooking before/after Pages::find? Link to comment Share on other sites More sharing options...
thomas Posted November 20, 2012 Author Share Posted November 20, 2012 It's working now ... I wasn't aware $event->return holds what the name implies Thanks! 1 Link to comment Share on other sites More sharing options...
Nico Knoll Posted December 7, 2012 Share Posted December 7, 2012 -- Moved into development -- 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