Jump to content

matt.k

Members
  • Posts

    4
  • Joined

  • Last visited

Profile Information

  • First Name
    Maciej
  • Last Name
    Kucia

Recent Profile Visitors

91 profile views

matt.k's Achievements

Newbie

Newbie (1/14)

1

Reputation

  1. Finally solved the problem by adding smarty variable 'message'. I wonder if this is a bug? <?php class mk_formpagedisplayModuleFrontController extends ModuleFrontController{ public function initContent(){ parent::initContent(); $this->context->smarty->assign('message', 'Why no one mentions this!??!'); $this->setTemplate('module:mk_formpage/views/templates/front/display.tpl'); } } Edit: Alternative solution is to add following block to the template: {block name="notifications"}{/block}
  2. Hi! I am trying to create a custom page in front office via custom module. Here is a minimal example: mk_formpage/ ├── mk_formpage.php ├── controllers/ │ └── front │ └── display.php └── views/ └── templates └── front └── display.tpl > display.php: <?php class mk_formpagedisplayModuleFrontController extends ModuleFrontController{ public function initContent(){ parent::initContent(); $this->setTemplate('module:mk_formpage/views/templates/front/display.tpl'); } } I can generate page using simple template: > display.tpl: <!doctype html> <!-- Note: this is just a fragment, it will not work --> <head> {block name='head} {include file='_partials/head.tpl'} {/block} </head> <body> Here my content {block name='javascript_bottom'} {hook h='...ClosingTag'} </body> </html> What I can't get to work is using more general templates: > display.tpl variation: {extends file='page.tpl'} {block name="page_content"} Here my content {/block} The error I am getting is: ContextErrorException in smarty_internal_templatebase.php(157) : eval()'d code line 445: Warning: htmlspecialchars() expects parameter 1 to be string, array given I have tried to debug this but without any luck. Docs are actually harmful since those are outdated Any help is appreciated!
×
×
  • Create New...