smarty concatanate a var from a file and a normal smarty one in the smarty include section

StackOverflow https://stackoverflow.com/questions/18501443

  •  26-06-2022
  •  | 
  •  

Вопрос

Hi I am trying to evaluate a variable from a file and a normal one but seems to be harder than it looks so :

This works:

{config_load file="archive_page.conf"
section="profile"} {include file="header.tpl" title=#pageTitle# keywords=#keywords# description=#description#}

I would like to also use my var and concatenate the text together so the below doesn't work also I have tried variations with '', "" but leads either an error message or one of the variables to display as text...

{config_load file="archive_page.conf"
section="profile"} {include file="header.tpl" title=#pageTitle#$MYVARHERE keywords=#keywords# description=#description#}

I tried various things but I can't get it to work, any help is much appreciated.

Это было полезно?

Решение

use the cat variable modifier:

title=#pageTitle#|cat:$MYVARHERE
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top