Hi, I am putting together a Child Theme for an OPS 3.4.0.4 installation. I plan to make brief styling modifications and add JS for the default theme.
I set up the structure, plugins loads correctly but in the Appearance section it does not show it for selection what is going wrong?
I have used import () and namespace with no success on both.
I have used $this->setParent(‘DefaultThemePlugin’); and removed it, and same thing.
Here the code:
<?php
require_once('LatArXivThemePlugin.inc.php');
return new \APP\plugins\themes\LatArXiv\LatArXivThemePlugin();
Other file LatArXivThemePlugin.inc.php
<?php
namespace APP\plugins\themes\LatArXiv;
use PKP\plugins\ThemePlugin;
class LatArXivThemePlugin extends ThemePlugin {
public function init() {
$this->setParent('DefaultThemePlugin');
// Añadir un archivo JavaScript
$this->addScript('mainScript', 'js/main.js');
// Añadir una hoja de estilo
$this->addStyle('styleSheets', 'css/styleSheets.css');
}
public function getDisplayName() {
return 'LatArXiv';
}
public function getDescription() {
return 'LatArXiv Child Theme';
}
}
The version.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE version SYSTEM "../../../lib/pkp/dtd/pluginVersion.dtd">
<version>
<!-- El nombre de la aplicación debe coincidir con la carpeta del tema para garantizar su unicidad -->
<application>LatArXiv</application>
<!-- El tipo siempre debe ser `plugins.themes` -->
<type>plugins.themes</type>
<!-- La versión actual. Siempre debe incluir 4 números. Ejemplos válidos: 1.0.2.3, 0.1.4.0 -->
<release>1.0.0.0</release>
<!-- La fecha de la versión más reciente -->
<date>2024-01-26</date>
<!-- Esto siempre debe ser 1 -->
<lazy-load>1</lazy-load>
<!-- El nombre de la clase del plugin. Consulta index.php -->
<class>LatArXivThemePlugin</class>
</version>
Thanks!