TZ Portfolio v3:Plugin

From TemPlaza Wiki
Jump to: navigation, search

Logov3.jpg

Introduction

TZ Portfolio inherits all the features of com_content so in this case we only mention the features that joomla not. If you want to know the basic features of com_content follow this path Joomla! Documentation

Creating a tz_portfolio plugin

Description

Creating TZ Portfolio Plugin similar to Creating a content Plugin but group is tz_portfolio, additional Config XML file and see Events.

Each plugin will create a tab containing the parameter to edit to edit or add the article Plugin-portolio.png

Config XML file

The XML file is config.xml, and is one of the three required files. Always start off with the XML tag and define that it is written in a UTF-8 format.

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE install PUBLIC "-//Joomla! 1.5//DTD plugin 1.0//EN" "http://www.joomla.org/xml/dtd/1.5/plugin-install.dtd">

To define that the parameters of the plugin used for each the articles to add the following line

<config>

Optionally, you could add some parameters to the Plugin. These will look like this:

<fieldset name="basic">

<field name="paramname" type="typeofparameter" default="defaultsetting" label="title" description="description"/>

</fieldset>

  • Param name: The name of the parameter. You will need this when creating the PHP file.
  • Param type: You could choose between several types of parameters. Look at this document to learn something about the different types: Using the core parameter types
  • Param default: The default setting for this parameter.
  • Param label: The name of this parameter displayed in the edit screen of this Plugin in the Plugin Manager.
  • Param description: The text which appears as a tool tip for this parameter.

Can create more fieldset and fields.

And do not forget to end your XML file with the following tag:

</config>

Events

onTZPluginPrepare

Use the following code:

function onTZPluginPrepare($context, &$article, &$params,&$pluginParams, $page){

//add your plugin codes here
return ' ';
//return a string value. Returned value from this event will be displayed in a placeholder.
// Most templates display this placeholder after the article separator.

}

The parameters article, params and limitstart should contain the following:

  • context: The context where this event was triggered (for example, 'com_tz_portfolio.portfolio'). Use this to check whether you are in the desired context for the plugin.
  • article : A reference to the article that is being rendered by the view.
  • params : A reference to an associative array of relevant parameters. The view determines what it considers to be relevant and passes that information along.
  • pluginParams : A reference to an associative array of relevant parameters of . The view determines what it considers to be relevant and passes that information along.
  • page: An integer that determines the "page" of the content that is to be generated. Note that in the context of views that might not generate HTML output, a page is a reasonably abstract concept that depends on the context.

onTZPluginAfterTitle

Use the following code:

function onTZPluginAfterTitle ($context, &$article, &$params,&$pluginParams, $page){

//add your plugin codes here
return ' ';
//return a string value. Returned value from this event will be displayed in a placeholder.
// Most templates display this placeholder after the article separator.

}

The parameters article, params and limitstart should contain the following:

  • context: The context where this event was triggered (for example, 'com_tz_portfolio.portfolio'). Use this to check whether you are in the desired context for the plugin.
  • article : A reference to the article that is being rendered by the view.
  • params : A reference to an associative array of relevant parameters. The view determines what it considers to be relevant and passes that information along.
  • pluginParams : A reference to an associative array of relevant parameters of . The view determines what it considers to be relevant and passes that information along.
  • page: An integer that determines the "page" of the content that is to be generated. Note that in the context of views that might not generate HTML output, a page is a reasonably abstract concept that depends on the context.

onTZPluginBeforeDisplay

Use the following code:

function onTZPluginBeforeDisplay ($context, &$article, &$params,&$pluginParams, $page){

//add your plugin codes here
return ' ';
//return a string value. Returned value from this event will be displayed in a placeholder.
// Most templates display this placeholder after the article separator.

}

The parameters article, params and limitstart should contain the following:

  • context: The context where this event was triggered (for example, 'com_tz_portfolio.portfolio'). Use this to check whether you are in the desired context for the plugin.
  • article : A reference to the article that is being rendered by the view.
  • params : A reference to an associative array of relevant parameters. The view determines what it considers to be relevant and passes that information along.
  • pluginParams : A reference to an associative array of relevant parameters of . The view determines what it considers to be relevant and passes that information along.
  • page: An integer that determines the "page" of the content that is to be generated. Note that in the context of views that might not generate HTML output, a page is a reasonably abstract concept that depends on the context.

onTZPluginAfterDisplay

Use the following code:

function onTZPluginAfterDisplay($context, &$article, &$params,&$pluginParams, $page){

//add your plugin codes here
return ' ';
//return a string value. Returned value from this event will be displayed in a placeholder.
// Most templates display this placeholder after the article separator.

}

The parameters article, params and limitstart should contain the following:

  • context: The context where this event was triggered (for example, 'com_tz_portfolio.portfolio'). Use this to check whether you are in the desired context for the plugin.
  • article : A reference to the article that is being rendered by the view.
  • params : A reference to an associative array of relevant parameters. The view determines what it considers to be relevant and passes that information along.
  • pluginParams : A reference to an associative array of relevant parameters of . The view determines what it considers to be relevant and passes that information along.
  • page: An integer that determines the "page" of the content that is to be generated. Note that in the context of views that might not generate HTML output, a page is a reasonably abstract concept that depends on the context.

INI file(s)

The same as Joomla INI file(s)


Quicklinks: Overview | Installation | How to Use | Administration | Configuration | Plugin | Video Tutorials