Juergen Posted March 1, 2016 Posted March 1, 2016 Hello @ all, I want to create a new render instance of an image field like described in this post https://processwire.com/blog/posts/processwire-3.0.7-expands-field-rendering-page-path-history-and-more/#specifying-custom-views I created the fields folder as described. Everything works fine if the render file is dirctly under the field folder, but if I want to use a custom rendering file it doesnt grab it. I have created a subfolder inside the fields folder which was named "products". In it I have a custom image file for a product image. The image field name is "singleimage" and the file inside the products folder is "singleimage.php". I have tried to render the image output in this way: echo $page->render('singleimage', '/products/singleimage'); Unfortunately it doesnt grab the file "singleimage" inside the "products" folder. It always uses the fallback. What can be the reason? Is the syntax wrong? I use the latest dev version of PW Best regards
BitPoet Posted March 1, 2016 Posted March 1, 2016 Try leaving out the leading slash, i.e. echo $page->render('singleimage', 'products/singleimage'); 2
szabesz Posted March 1, 2016 Posted March 1, 2016 I already started using this feature and no problem so far (without the leading slash, of course). Are you sure "singleimage.php" is in the "products" folder (without any spelling mistakes)? In your screenshot we can see a "singleimage.php" file that is NOT in the "products" folder, but we cannot see the contents of "products". 1
Juergen Posted March 1, 2016 Author Posted March 1, 2016 Hello szabesz, thanks for your reply. Yes there is a singleimage.php inside the products folder (without any writing mistakes). Thats the reason why I cannot find an explanation why it doesnt work. You write in your case it works well, so the problem is somewhere on my side.
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