Jump to content

PW 3.0.7: Expands Field Rendering, Page Path History and More


ryan
 Share

Recommended Posts

This week we have another new ProcessWire 3.x version for you that includes several updates and optimizations. We’ve also greatly expanded upon the field rendering with template files, with lots of info covered in this post.

https://processwire.com/blog/posts/processwire-3.0.7-expands-field-rendering-page-path-history-and-more/

  • Like 13
Link to comment
Share on other sites

Just read the blog post - wonderful!

I have said it before and it stands repeating - one of the great things about PW (and there are many) is that updates and new features make so much sense.

This field template/page template pairs is sooo powerful. Of course we could already do all this with includes and such, but one great strength of this being built in to PW is future maintainability. Someone (either someone else or me) looking at a template of mine in a couple of years would need to figure out how all these template partials are organised. Now, there's a standard way and it's documented here.

  • Like 3
Link to comment
Share on other sites

hi,

I just installed a clean 3.0.7devns with blank profile, added language support, enabled advanced mode and debug, to test and play with the fields rendering, because this will be of great use in a upcoming project… :-)

but somehow this (maybe too clean?) installation only renders the file found directly in /site/templates/fields/

my test setup:

just a basic page with title field (changed the field type to: PageTitleLanguage, but changing it back to PageTitle doesn't change the behaviour).

/site/templates/fields/title.php  <--- prints out title in green

/site/templates/fields/basic-page/title.php <--- prints out title in red

the code in the title.php files is:

<header>
    <h1 style="color: green;">(in /site/templates/fields/title.php) <?php echo $page->title; ?></h1>
</header>
<header>
    <h1 style="color: red;">(in /site/templates/fields/basic-page/title.php) <?php echo $page->title; ?></h1>
</header>

the code in the basic-page.php template is:

<?php echo $page->render('title'); ?>

in the frontend I only see the green title, from the blog post I would expect the red title to show.

If I remove the title.php directly under /site/templates/fields/ the frontend rendering is unstyled.

Am I missing something?

cheers
Tom

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