thomas Posted June 25 Share Posted June 25 Hi everyone, I have a site which uses a bunch of images per page and now I am about to change the template. Problem is that the first call of those pages takes forever since it creates all image variants. Is there a method to iterate over all those pages and create the images or would I have to create a hook for that? Problem is that the actual size of those images is calculated individually in the template so I would either have to duplicate the logic in this hook or parse the templates which I wouldn't know how ... Anyone got an idea? Thanks! Link to comment Share on other sites More sharing options...
BillH Posted June 27 Share Posted June 27 I haven't tried (and so could easily be wrong!), but I think the following would work: foreach ($pages->find("template=template_name") as $page) { ob_start(); $page->render(); ob_end_clean(); } The output buffering is to stop the pages rendering in the browser. It'd probably be easiest to put the code in a template file. 1 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