Author Topic: how can i get html-tags not parsed  (Read 1223 times)

0 Members and 1 Guest are viewing this topic.

schibumi

  • Guest
how can i get html-tags not parsed
on: Thu, 10. October 2002 - 22:39:43
hi,

i have a problem. i tried to get my output like normal html-tag. but when the code run through the parser i get it always transformed into the special-characters.

index.php
Code: [Select]
...
tmpl = new vlibTemplatetemplates/index.html;
phpbody = my body is byour/b body ;
tmpl-setVarmybody, phpbody;
...
index.html
Code: [Select]
...
tmpl_var name=mybody
...
as output i get: my body is <b>your</b> body instead of: my body is your body

how can i solve this problem?
schibumi
Last Edit: Wed, 13. April 2005 - 16:39:14 by ClausVB

releasedj

  • Guest
how can i get html-tags not parsed
Reply #1 on: Fri, 11. October 2002 - 09:41:06
You can do this:

<tmpl_var name="mybody" escape="none">

In your vlibIni.php file, there's an Option called DEFAULT_ESCAPE.
By default, this is set to html, which is helpful as you don't have to escape your vars on every tag (like above)... vlibTemplate will do it automatically.

To see what options are available, go to the OPTIONS section of the vlibTemplate doc.

Kind regards,

Kelvin

Offline ClausVB

  • Administrator
  • Hero Member
  • *****
  • Posts: 566
    • Homepage: clausvb.de
how can i get html-tags not parsed
Reply #2 on: Fri, 11. October 2002 - 09:45:26
Is it possible to always parse all HTML-Tags?

I tried to figure it out, but in the end I ended up always using "escape="none">".

PS: Schibumi, wenn Du Fragen hast und ich Dir helfen kann, kannst Du mich anmailen. Ich habe jede Menge Erfahrung mit vlibTemplate.
Last Edit: Wed, 07. March 2007 - 10:32:11 by ClausVB

releasedj

  • Guest
how can i get html-tags not parsed
Reply #3 on: Fri, 11. October 2002 - 09:54:38
Sure, in your vlibIni.php file set the DEFAULT_ESCAPE parameter to 'none'.

Then in your template file, if you need to escape a particular var you can do:
<tmpl_var name="varname" escape="html">

Regards,

Kelvin