HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


tempcode parameter documentation?

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#61466 (In Topic #13388)
Avatar

Fan in action

Looking for documentation or definitions for tempcode parameters

Hello! I'm trying to get my head around Tempcode. The Tempcode programming tutorial explains that language strings are defined in the .ini files. Symbols and directives seem to be well documented in the tutorial itself. Looking through some of the template files, I see parameters like {META}, {MESSAGE}, {BRAND_NAME}, {BREADCRUMBS}, {MIDDLE}, and others. But I haven't been able to find any documentation on specific parameters, nor have I figured out where they're defined in the code. Can anyone point me in the right direction?

Thanks in advance!

Cliff
Back to the top
 
Posted
Rating:
#61511
Avatar

Fan in action

Okay…still no luck finding documentation on specific parameters, but I did find the quick insertion links on the Edit Template page in the Admin Zone.  It lets you choose from a list of params.  The choices vary with the template file you're editing, so it seems the system is smart enough to know (and tell you) what you can access based on context.  I like it.   :thumbs:

One thing that still confuses me:  if I do insert a param in this fashion, the insertion will include a "$" character.  For example, {$HEADER_TEXT} in HEADER.tpl.  But examples of this (and other) params in the virgin file omit the "$": e.g.,   {HEADER_TEXT}.  Does anybody know why this is?

The other thing that clicked into place was the association between "code names" and parameters.  So, for example, every image in the system (logos, icons, etc.) gets a code name, and you can refer to the image by its code name:  {$IMG,<codename>}, for example.  (Allen explains this in the Themes 101 video tutorial.)  This makes me suspect that params must be defined in a database rather than source code.
Back to the top
 
Posted
Rating:
#61521
Avatar

{$WHATEVER} is a symbol. All are listed in our Tempcode tutorial.

{WHATEVER} are parameters. Passed in by PHP, varying from template to template.

Parameters are data specifically intended for a certain template.
Symbols provide data or common functions that any template can use.
{$IMG,whatever} is an example of one commonly used symbol that retrieves a theme image's URL.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#61523
Avatar

Fan in action

Hi Chris,

That all makes sense and is totally consistent with the documentation.  But the "Insert Parameter" button (under "Symbols, Directives, and Parameters") inserts what then appears to be a symbol rather than a parameter.

For example, I'm editing HEADER.tpl:

- I position my cursor just below the opening body tag (just before "{+START,IF,{SHOW_TOP}}").
- I open "Symbols, Directives, and Parameters."
- I choose "HEADER_TEXT" from the "Insert Parameter" choices.
- I click "Insert Parameter."
- The text "{$HEADER_TEXT}" now appears in the edit window where I had positioned the cursor.

But this would appear to be a symbol rather than a parameter (i.e., "{HEADER_TEXT}").  Am I doing something wrong?  Could it be a bug?  Or maybe I'm just misinterpreting the behavior somehow?

Btw, I used the forum with the intention of tapping community wisdom and trying not to bother you with this.  Please tell me if you'd prefer this sort of post elsewhere.   :)

Thanks!

Cliff
Back to the top
 
Posted
Rating:
#61524
Avatar

Fan in action

Quick follow-up on this:  I think it's a bug.  I added a <p> to HEADER.tpl that just contains the DESCRIPTION parameter.

Using the "Insert Parameter" button inserts "{$DESCRIPTION}."  Nothing happens when I re-load the associated web page.

Deleting the "$" character (so that the parameter is now  {DESCRIPTION}) seems to work.  That is, my site's description now displays as a <p> element when I reload the page.

Does this all sound right?  I'll go ahead and log a bug for this.
Back to the top
 
Posted
Rating:
#61552
Avatar

Fan in action

I found some documentation on specific parameters, btw:  Philip's "Specific Templates and CSS Classes," in the Visual Customisation section.

 :$
Back to the top
 
Posted
Rating:
#61561
Avatar

You're 100% correct. We will fix in the next version, this bug must have existed for quite a while now.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
There are too many online users to list.
Control functions:

Quick reply   Contract

Your name:
Your message: