======Core Wrap Tag====== =====CORE:WRAP===== Wrap a named tag with the contents of a file ====Syntax==== ====Description==== The ''core:wrap'' tag is a [[wact:api:template:compiler:CompilerDirectiveTag]] and has no corresponding [[wact:api:template:Component]]. The contents of the current file are placed inside the contents of the file specified in the file attribute, replacing the [[wact:api:template:PlaceHolderComponent]] refered to by name from the httpplaceholder tag. Note to beginners: You don't need a closing tag for this. ====Examples==== A quick example to make this less abstract: Let's suppose you have a page controller where you want to load some variable content, like a specific news item: ... $Page =& new Template('/' . $newsitem . '.tpl.htm'); $Page->display(); Now, one of your actual news items, e.g. a file called "04101980hilly.tpl.htm", might contain this: 04/10/1980: Buddy Hilly goes east This is your news item text. See the reference to the ''main.tpl.htm'' at the top? The main template might contain a header and footer, and is "wrapped" around your content. You have to put a '''' tag in the main template to tell the compiler where to put the content. The ID of this tag must match the "placeholder" attribute you defined in your news item template. ''main.tpl.htm'' might contain this: ... ... That's it. You'll find another example in the [[wact:tag examples]] section.