HTML blocks - language variable not showing correctly

Hi guys,



I created HTML block with

tags but {$lang.sign_in} or any other variable is showing in block as “{$lang.sign_in}” not its value.

Anybody can help?

You can't use template variables in html blocks. The template engine has already run. HTML only.

[quote name='tbirnseth' timestamp='1329632655' post='131581']

You can't use template variables in html blocks. The template engine has already run. HTML only.

[/quote]



Thank you tbirnseth.

I will create html file and include it into bottom.tpl file where I need html block for my site.

[quote name='tbirnseth' timestamp='1329632655' post='131581']

You can't use template variables in html blocks. The template engine has already run. HTML only.

[/quote]



Can template variables be used in language variables? For example, I'd like to add the following to the top of the “edp_access_granted” language variable:



{$lang.edp_access_subj}

No, you can't nest template variables (I don't think). So having a lang variable of:

my_lan_var = This is a {$lang.big} test

Won't work.



If you need to use template variables, then don't use a HTML block, just create a regular block and use them all you want.

I would probably need to do something like this where [limit] is the in the language variable:



{$lang.file_download_limit_exceeded|replace:"[limit]":$file.max_downloads}

That's fine, you just can't do it in an HTML block. It has to be a normal block to use template variables. Note that an html block is really only

```php


{$content}

```
In the html block template.

Is the Smarty function {eval} available to use? for example, {eval var=$content} so it parses Smarty variables added into the HTML Block editor?



EDIT: This does work!

For example, the template variable inside of the customer template, blocks/unique_html_block.tpl, can be changed to: {eval var=$items.block_text|unescape}



Then smarty variables will be parsed. For example, try placing {$config.current_url} inside of the HTML block editor to see the page's address string after the domain name.



The other cool thing about this is that HTML and Unique HTML blocks are not cached. Other blocks, like product and category menus are cached and makes it impossible to use template variables that change when the page changes. And the Smarty nocache parameter is ignored in them. So, the HTML Blocks appear to give full use of template variables and Smarty.