Web Connection
Import snippets befor expand
Gravatar is a globally recognized avatar based on your email address. Import snippets befor expand
  Joachim Kumpa
  All
  Aug 10, 2026 @ 02:12pm

I have several templates with VFP expressions. Each template partially uses the same HTML code, which also contains VFP expressions. I want to write this code into separate snippets. These snippets need to be imported into the templates before the entire template is passed to wwResponse::ExpandTemplate. How is this possible?

Gravatar is a globally recognized avatar based on your email address. re: Import snippets befor expand
  Rick Strahl
  Joachim Kumpa
  Aug 11, 2026 @ 11:12am

You can use <%= RenderPartial() %> to embed nested templates.

Layout Pages, Content Pages and Partials

It works better with ExpandScript() than ExpandTemplate() but partials work reasonably well with ExpandTemplate().

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Import snippets befor expand
  Joachim Kumpa
  Rick Strahl
  Aug 11, 2026 @ 01:05pm

Hi Rick, Thank you for the tip. I'll set up a test case and give it a try. I'll let you know the result.

© 1996-2026