Jump to content

Problems using the new field rendering option in PW3


Juergen
 Share

Recommended Posts

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.

post-2257-0-76813000-1456822740_thumb.jp

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

Link to comment
Share on other sites

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".

  • Like 1
Link to comment
Share on other sites

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. ???

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...