Documentation

Content Modifiers

Loading Modules in Articles

Modules may be loaded in an article by including a specific {xhub:module} tag. This tag requires one attribute: position, which specifies the position that you wish to load. Any modules assigned to the specified position (set via the administrative Module Manager) declared in the position attribute will have their output placed in the article in the location of the {xhub:module} tag.

{xhub:module position="footer"}

Note: To use this feature, the xHUB Tags plugin for content must be installed and active.

Including CSS or JavaScript

Sometimes we need to load a stylesheet or script for a specific article. HUBzero allows this through the use of the xHUB content plugin. CSS and JavaScript may be loaded in an article by including a specific {xhub:include} tag. This tag has a few attributes, each with multiple options:

type
Required. Determines what sort of file to be included. Accepts "script" or "stylesheet".
filename
Required. The name of the file to be included.
component
Optional. The name of the component the file is to be included from. If not specified, the file will be included from the template's directory.
<!-- A stylesheet called "home.css" from the current template's /css folder -->
{xhub:include type="stylesheet" filename="home.css"}

<!-- A script called "resources.js" from the com_resources component -->
{xhub:include type="script" filename="resources.js" component="com_resources"}

Note: To use this feature, the xHUB Tags plugin for content must be installed and active.

Outputting Hub Configurations

Sometimes we need to output the value of a specific hub configuration setting. HUBzero allows this through the use of the xHUB content plugin. HUBzero based configurations (not Joomla!) may be loaded in an article by including a specific {xhub:getCfg} tag. This tag has one attribute: the name of whatever configuration variable you wish to output.

{xhub:getCfg hubShortName}

Note: To use this feature, the xHUB Tags plugin for content must be installed and active.

We also advise extreme caution when using this particular {xhub} tag.

See Hub Configuration for more information on what configurations are available and how to set them.

Getting The Template Directory

Sometimes we need to include content (images, javascript, etc.) from the active template's directory. HUBzero allows this through the use of the xHUB content plugin. The name of the active template will be outputted in an article by including the templatedir xhub tag. This tag has no attributes.

<img src="/{xhub:templatedir}/images/logo.png" alt="Our Logo" />
<!-- outputs: -->
<img src="/templates/mytemplate/images/logo.png" alt="Our Logo" />

Note: To use this feature, the xHUB Tags plugin for content must be installed and active.

Last modified:

  • Copyright © 2022 Hubzero
  • Powered by Hubzero®