I am working on OJS 3.0.1 in spanish and when i create a custom block, it doesn’t show the title so I modified getContents function at this file plugins/generic/customBlockManager/CustomBlockPlugin.inc.php into:
function getContents(&$templateMgr, $request = null) {
// Ensure that we’re dealing with a request with context
$context = $request->getContext();
if (!$context) return ‘’;
// Get the block contents. $customBlockName = $this->getName(); $customBlockContent = $this->getSetting($context->getId(), 'blockContent'); $currentLocale = AppLocale::getLocale(); $divCustomBlockId = 'customblock-'.preg_replace('/\W+/', '-', $this->getName()); $templateMgr->assign('customBlockId', $divCustomBlockId); $templateMgr->assign('customBlockContent', $customBlockContent[$currentLocale]); $templateMgr->assign('customBlockName', $customBlockName); return parent::getContents($templateMgr, $request); }
I added customBlockName variable to use it in plugins/generic/customBlockManager/block.tpl file:
> <div class="pkp_block block_custom" id="{$customBlockId|escape}">
> <span class="title">
> {$customBlockName}
> </span>
> <div class="content">
> {$customBlockContent}
> </div>
> </div>
this way I could show title in the custom block.
Greetings