Loading ...
Sorry, an error occurred while loading the content.

12668Re: [Clip] Pass data to Templates?

Expand Messages
  • hsavage
    Oct 30, 2004
      melchior prisi wrote:
      > Hi,
      > ----- on 27.10.2004 20:11 hsavage wrote:
      >> I have 2, so far, very dependable methods for passing data, in the form
      >> of variables, to a template file.
      > Instead of .ini I often use texttofile/getfiletext
      > to store/call data:
      > Clip:
      > ^!texttofile "^$getdocumentpath$data.txt" hello world
      > Template:
      > ^!set %var%=^$getfiletext(^$getdocumentpath$data.txt)$
      > (When assigning clip code to variables
      > remember the ^!SetCode command...)
      > Regards,
      > Melchior


      If you'll notice, the ^!Set %var%= listed under template is in the
      category of a function that conforms to the comment from my first email.

      >- Clip commands that work in a template file appear to have to be
      >- that is, they must be determined, or, assigned as, or after, the
      template loads.

      I've used the methods above plus .inifiles. There really isn't another
      option for my use, the webpages I create with the templates have up to
      48 data variables to convert- or add, some short and some are several
      sentences long, and depending on the number of photos, per page could be
      up to 32, included there are at least 2 calculations per photo to
      automatically determine its display size.

      Using the ^!Set and ^!SaveValue commands, the ^$GetValue(":")$ function
      and ^$Calc(;0)$ function, all the data entries become 'dynamic', plus, I
      need the inifiles to store the data in text form for later use,
      reference and/or editing. It's much easier to edit a text inifile, then
      make and upload a new, corrected page.

      What I'm fishing for is a way to set a few variables or some function
      before loading a template and have those variables or function be active
      in the template after the template loads, so far, no luck. The more
      familiar I become with templates the less important this becomes.

    • Show all 4 messages in this topic