HTML Logo by World Wide Web Consortium ( 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 for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.

Reference manual for Tempcode?

Login / Search

 [ Join | More ]
 Add topic 
#67568 (In Topic #14401)

Fan in training

I'm trying to figure out Tempcode by editing existing templates. I commented something out as if it were HTML, and the menu at the top disappeared as I expected, but I ended up with "–>" where it was. What's the proper way to comment out Tempcode?

So far I've figured out this:
The "Forums Rules Members" menu is shown by "{$GET,panel_top}" in GLOBAL.tpl.
panel_top is a variable set in HEADER.tpl by "{$LOAD_PANEL,top}".
LOAD_PANEL reads it from pages/comcode/EN/panel_top.txt.
This contains a block called side_stored_menu.
There's a page called sources/blocks/side_stored_menu.php.
This page doesn't contain "Forums Rules Members", so I'm lost.

Is there a reference manual? The tutorials aren't helping me understand the language or how the existing code works.
Back to the top

Right, there are a few different places that cover this.

The first bit is in the WYSIWYG tutorial. It's actually a Tempcode comment that ocPortal picks up on. So it's not real Tempcode, it's just a way we could add in a little hint that a different part of the system would interpret.

The --> is probably because you have nested HTML comments. This is a real pain, if there is a comment inside what you're commenting out, it won't work, because you cannot nest comments.
A Tempcode comment will work great.
{$,...} (where ... is what is being commented out).

The Tempcode tutorial lists all the Tempcode language. So that's the Tempcode language reference.

Our recent "Designer themes" tutorial goes into a lot of examples of usage of Tempcode which should answer all your practical usage questions.

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
1 guests and 0 members have just viewed this: None
Control functions:

Quick reply   Contract

Your name:
Your message: