Hello World package is a simply package to explain how a very simple package can be created.

Hello World Package is define the following:

  • Block: Display a text that is taken as Block Shortcode Parameter.
  • Template: Style the displayed text.
  • readme
  • license

Template Code

h1.hello-world-text {font-size: 24px; color: red}

Block Code

<h1 class="hello-world-text">
<?php
// Display text as passed for the Text input parameter.
echo $cb->params()->get('text');
?>
</h1>

definition.xml File

<?xml version="1.0" encoding="utf-8" ?>
<package xmlns="http://css-javascript-toolbox/xml/namespaces/cjt/6/package">
<name>HelloWorld</name>
<description>CJT Hello World package example</description>
<author>CJT</author>
<webSite>https://css-javascript-toolbox.com/scripts/examples/HelloWorld/</webSite>
<license locate="file" />
<readme locate="file" />
<objects>
<object type="template">
<name>hello-world-style-sheet</name>
<description>Hello World Stylesheet file</description>
<code locate="file">template/style.css</code>
</object>
<object type="block">
<name>HelloWorld</name>
<code locate="file">block/hello-world.php</code>
<params>
<form>
<name>Hello World</name>
<groupType>tab</groupType>
<groups>
<group>
<name>General</name>
</group>
</groups>
</form>
<list>
<param>
<name>Text</name>
<type>text</type>
<group name="General">
<renderer>input</renderer>
</group>
</param>
</list>
</params>
<links>
<link name="hello-world-style-sheet" />
</links>
</object>
</objects>
</package>

The package is also available for hello-world