Web Connection
Embedded Code for the <head> section.
Gravatar is a globally recognized avatar based on your email address. Embedded Code for the <head> section.
  Rob Corbett
  All
  Apr 26, 2017 @ 08:20am

If you have embedded expressions (<%= MyVariable %>) and code blocks (<% VFP code %>) within the '<'head'>' section that you want to keep in a head template file, what is the best way to have those evaluated? The expandTemplate() and expandScript() functions seem custom built for the '<'body'>' section only. The items I'm referring to do not work with the AppendHeader() function and it seems I can only add these head items with RawHeader(). Ideally I would be able keep template files with both '<'head'>' and '<'body'>' with embedded code within each section.

Gravatar is a globally recognized avatar based on your email address. re: Embedded Code for the <head> section.
  Rick Strahl
  Rob Corbett
  Apr 26, 2017 @ 12:52pm

Expressions work anywhere in the page, but if you have a layout page (ie. top level template) then those values are not applied. The best way to do this is to use sections in the layout page to add additional items, and then reference those sections from the actual pages. Inside of the sections you can then apply additional expressions that are dynamic.

+++ Rick ---

© 1996-2024