Add menu item in Hosted Journals

Hi,
I am using 3.1.0 from git with PHP 5.6
I would like to add a new menu in this template.(Administration/Hosted Journals)
I copied templates/admin/contexts.tpl to templates/admin/contexts_1.tpl

I add this line in templates/admin/index.tpl

<li><a href="{url op="contexts_1"}">{translate key="Context_1"}</a></li>

What is the best way or the best practice without not change core files ?

image

Regards,
xavi.

hola xavi, échale un vistazo a:

Si te surgen dudas, puedes exponerlas.

1 Like

I don’t need currently change the Styles, I would like to add a new item in this area with name “others” and a new Wizard with “n” checks to insert in my database (setting_name, and setting_values)
I am duplicating the files
lib/pkp/controllers/grid/admin/contextgridRow
to add a new code in this class with new menus, but I am little bit lost…

I’m not sure it with a new child theme can I do this.

1 Like

Sí, se puede hacer.

cd /plugins/themes
mkdir default-child
cd default-child
nano index.php
<?php

/**
 * @defgroup plugins_themes_default_child Default theme plugin
 */

/**
 * @file plugins/themes/default-child/index.php
 *
 * Copyright (c) 2014-2016 Simon Fraser University Library
 * Copyright (c) 2003-2016 John Willinsky
 * Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
 *
 * @ingroup plugins_themes_default-child
 * @brief Wrapper for default child theme plugin.
 *
 */

require_once('DefaultChildThemePlugin.inc.php');

return new DefaultChildThemePlugin();

?>

nano DefaultChildThemePlugin.inc.php 
 


<?php

/**
 * @file plugins/themes/default/DefaultChildThemePlugin.inc.php
 *
 * Copyright (c) 2014-2016 Simon Fraser University Library
 * Copyright (c) 2003-2016 John Willinsky
 * Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
 *
 * @class DefaultChildThemePlugin
 * @ingroup plugins_themes_default
 *
 * @brief Default theme
 */
import('lib.pkp.classes.plugins.ThemePlugin');

class DefaultChildThemePlugin extends ThemePlugin {
	/**
	 * Initialize the theme's styles, scripts and hooks. This is only run for
	 * the currently active theme.
	 *
	 * @return null
	 */
	public function init() {
		$this->setParent('defaultthemeplugin');
        }
	function getDisplayName() {
		return __('plugins.themes.default-child.name');
	}

	/**
	 * Get the description of this plugin
	 * @return string
	 */
	function getDescription() {
		return __('plugins.themes.default-child.description');
	}
}
?>


nano version.xml

<!--
  * plugins/themes/default-child/version.xml
  *
  * Copyright (c) 2014-2016 Simon Fraser University Library
  * Copyright (c) 2003-2016 John Willinsky
  * Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
  *
  * Plugin version information.
  -->

<version>
	<!-- The application should match the theme folder to ensure it is unique -->
	<application>default-child</application>

	<!-- The type should always be `plugins.themes` -->
	<type>plugins.themes</type>

	<!--
		The current version. It should always include 4 numbers.
	    Valid: 1.0.2.3, 0.1.4.0
		Invalid: 1.0, v1.0.4, 1.0.0.0b
	-->
	<release>1.0.0.0</release>

	<!-- The date of the latest version -->
	<date>2016-05-31</date>

	<!-- This should always be 0 -->
	<lazy-load>0</lazy-load>

	<!-- The class name of the plugin. See index.php -->
	<class>DefaultChildThemePlugin</class>
</version>


mkdir templates
cd templates
mkdir admin
cd admin
cp /templates/admin/contexts.tpl .
# y lo extiendes 'modificas como quieras'

Ahora en la administración activas el default-child y limpiar cachés por si acaso. Espero te sirva. De esta manera, ante actualizaciones, no afectaría.

1 Like