xoops forums

alain01

Quite a regular
Posted on: 1/11 18:21
alain01
alain01 (Show more)
Quite a regular
Posts: 389
Since: 2003/6/20
#1

Customize Blocks and smarty variable

Hi,
i have added some code full bootsrap4 in my theme.tpl file in my theme.
All is ok
But now, i want to move this code from theme.tpl to customize blocks.

All is the same except smarty variables.

in my theme.tpl :
<img class="mb-1" src="<{$xoops_imageurl}>images/logo-xoops.png" alt="<{$xoops_sitename}>" width="200px">


but if i put this code in customize block, the block cant interpret smarty variable.

May be it's a noob question...
Is it possible to use "assign" function in customize blocks like in theme.tpl ?
For example, in theme.tpl, i use
<{xoMemberInfo assign=member_info}>
and
<{xoInboxCount assign="unread_count" total='inbox_total'}>
.

Sure, i can put Hard link in my block but i hate that,
i can put absolut link too (/themes/mytheme/images/) but it's bad too.

I want used a smarty variable to extract the path theme..
SO
How ?
Thank you in advance !

Alain

geekwright

Quite a regular
Posted on: 1/12 3:26
geekwright
geekwright (Show more)
Quite a regular
Posts: 302
Since: 2010/10/15
#2

Re: Customize Blocks and smarty variable

There is no variable processing inside custom HTML blocks. Smarty, and all of its functions, is not available.

There is one replacement that can help in any custom blocks. The code:
{X_SITEURL}
will be replaced with the XOOPS_URL with a trailing slash. You can use that to build URLs for pages or sites.

I have used that to more easily move things from a development system to a production environment, without making changes.

Long term, the next generation XOOPS has shortcodes which will be available in almost any context. That will provide a more complete and extensible solution.

alain01

Quite a regular
Posted on: 1/12 8:54
alain01
alain01 (Show more)
Quite a regular
Posts: 389
Since: 2003/6/20
#3

Re: Customize Blocks and smarty variable

Haaaaa,
{X_SITEURL} !!!

Sure, thank you, it works like i want.
Quote:
I have used that to more easily move things from a development system to a production environment, without making changes.
Yes, exactly

Haaaa, shortcodes,
I remember this news, now !
I was so happy to read this very good news !
It's a very powerful and amazing new fonction !
Again 1 time, i'm unpatient to use the 2.6 version in stable and production stage...