How can I override backend templates (OJS 3)?

Hi @NateWr,
I added in fetch() function:

$testDao = DAORegistry::getDAO('TestDAO');
$testing = $testDao->getAllTestWithId(); //return array[id][name]
$templateMgr->assign('testing', $testing);  

I added in my theme/testing/templates/admin/contextSettings.tpl

{$testing|@var_dump} 
{php} var_dump($testing); {/php}

I’ts not working…

I checked my function getAllTestWithId() to print in my templates/frontend/pages/testing.tpl and it’s working.

Regards,
xavi

Can you share the full fetch() function’s code?

function fetch($request) {
		$templateMgr = TemplateManager::getManager($request);
//I added this with my DAO and I called  the function with all data                 
        $testDao = DAORegistry::getDAO('TestDAO');
        $testing = $testDao->getAllTestWithId(); //return array[id][name]
	    $templateMgr->assign('testing', $testing);
                
        $templateMgr->assign('contextId', $this->contextId);                                
	    return parent::fetch($request);
	}

Regards,
xavi.

Sorry @NateWr, I used other ContextTestSiteSettingsForm.inc.php
If I used original ContextSiteSettingsForm.inc.php it’s working.

Solved problem.

@NateWr,

I don’t like to modify original code so I created new files :

  • ojs/controllers/grid/admin/journal/form/JournalTestSettingsForm.inc.php → import ContextTestSiteSettingsForm (fetch() function) NOT WORKING

  • ojs/controllers/grid/admin/journal/JournalTestGridHandler.inc.php → call JournalTestSiteSettingsForm.inc.php

  • ojs/controllers/grid/admin/journal/JournalTestGridHandler.inc.php → call JournalTestSettingsForm.inc.php

In my theme I call on form: grid.admin.journal.JournalTestGridHandler
I saved my data in Database but I have the problem with fetch function.

Hi @xavi,

Your fetch() function looks ok, so I think it is more likely that it is not being called. Can you put all of your theme code into a public repository, like one at GitHub, where I can take a look at it?

Nate

Hi, I send you a private message.

Thanks.
xavi.