Components Anywhere

Place components anywhere in Joomla!

  • Last updated: 03 Apr 2019
  • Version: 4.5.0
  • Type: System plugin
  • Joomla rating: 100%

Tutorial for Components Anywhere

There is a Free and a Pro version of Components Anywhere.
The parts in this tutorial that only concern the Pro version will be marked with: Pro only

Introduction

Components Anywhere is a Joomla! system plugin.

It allows you to place components anywhere in your site, including within articles, inside modules, or even inside 3rd party components and template overrides.

For instance, you have a form component - that does not come with its own module version - and you want to display the form in a module. With Components Anywhere, you can do so.

You can place components literally anywhere you want, wherever you have the ability to enter text.

How to use it (syntax)

You can place components via Components Anywhere by using plugin style tags right into your WYSIWYG editor.

The syntax is very simple. You use a {component} tag and specify the (relative) URL of the component you want to show:

{component url-of-the-component}

Let's say you have a form component with this url: https://www.yoursite.com/index.php?option=com_myform&formid=3

To display the form in a module, simply create a new "Custom HTML" module and place this tag in the content editor:

{component index.php?option=com_myform&formid=3}

You may also place the url in a url parameter. So this will also work the same:

{component url="index.php?option=com_myform&formid=3"}

Note: You can also use SEF URLs inside the {component} tag, but we recommend you use non-SEF urls when possible.

Using Menu Item to get the correct URL

As said above, we recommend you use the non-sef url inside the {component} tag. But getting that url is not that straight-forward for some components.

Let's take the Weblinks Component as an example. And let's say we want to show all weblinks from category with id 2.

When editing the weblinks in the administrator, we can see option=com_weblinks in the url. So we know the name of the component that follows option.

Since we want to view a category, we could guess that the view part will be category. But that's just guessing. So we don't know if the urls should be index.php?option=com_weblinks&view=category&id=2 or index.php?option=com_weblinks&view=cat&cid=2, or something else. The logic behind the urls differs per component.

So how do we find the correct URL?

Well, the easiest way to get a component URL is to create a Menu Item.

When creating a menu item, we need to select the desired component as "Menu Item Type". In this case, we select List Web Links in a Category - and then select the category we want to use. After saving it, we will see the correct url in the Link field:

Menu Item

So the plugin tag to use will simply be:

{component index.php?option=com_weblinks&view=category&id=2}

You could now even delete the menu item, as the url used in the {component} tag is not connected to that menu item - we just needed it to know what url to use.

Component parameters

However, in many cases you do want and need a menu item. Because you want to be able to control the extra settings that come with the component.

When using the basic url index.php?option=com_weblinks&view=category&id=2, the component will show the requested category, but will use the default settings for everything else.

To control the settings of a component - such as whether or not to show the category title and description, whether or not to show subcategories, etc - you need a menu item.

So we'll keep this menu item and set the extra settings we need. However, the plugin tag we used in above example still doesn't use that specific menu item. It is still just using the default component settings.

To tell Components Anywhere to use the desired menu item, we need to add the menu item ID to the url inside the plugin tag. We do this by using the Itemid parameter.

To find the menu item ID, just look in the menu items list (ID is on the right) or look in the url when editing the menu item in question:

Menu Url

So in this example the menu item it is 123. Than means the full url to use is:

{component index.php?option=com_weblinks&view=category&id=2&Itemid=123}

Now, any changes you make to that menu item settings will also be reflected in the output of the Components Anywhere tag.

Note: Make sure the Menu Item is "Published" and its Access Level is set to "Public". If you do not want the menu item to show up in your website menus, in the menu item settings under "Link Type", you can set the "Display in Menu" option to "No".

Advanced Security Pro only

The Pro version of Components Anywhere offers advanced Security Control over who can use the extension and where it can be used.

These settings can be useful on websites where multiple people have rights to create and publish content.

You can control in which components or areas of the site Components Anywhere should be enabled, and which User Groups are allowed to use it.

The advice is to not allow the usage in components where non-backend users can post content. For instance in forums and message boards.

See the "Security Options" tab in the Components Anywhere system plugin settings for all the different settings

Settings

Components Anywhere has some options, giving you control over how it works and behaves. Here is the full list of the options you can find in the Components Anywhere system plugin settings:

Behaviour

Enable Caching Select to enable caching of components output.
Add Scripts & Styles Select to add the scripts and styles to the document that get loaded by the component. Only switch this off if you have issues with duplicate loaded files due to caching extensions, for instance.
Can be overruled via the tag like: {component url="url-of-the-component" add_styles_scripts="true"}
Add Scripts (JavaScripts) Select to add the scripts to the document that get loaded by the component. Only switch this off if you have issues with duplicate loaded files due to caching extensions, for instance.
Can be overruled via the tag like: {component url="url-of-the-component" add_scripts="true"}
Add Styles (CSS) Select to add the styles to the document that get loaded by the component. Only switch this off if you have issues with duplicate loaded files due to caching extensions, for instance.
Can be overruled via the tag like: {component url="url-of-the-component" add_styles="true"}
Add Meta Tags Select to add other meta tags to the document that get generated by the component. Only switch this off if you have issues with duplicate loaded files due to caching extensions, for instance.
Can be overruled via the tag like: {component url="url-of-the-component" add_meta="true"}

Security Options Pro only

Articles

These settings have effect on Articles and Categories.

Enable in articles Select whether to enable the use of the syntax in articles.
Security Level Set the level of security. Components Anywhere tags will be stripped from articles with an owner (creator) below this group level.

Components

These settings have effect on the component area.
You can select in which components Components Anywhere should not be enabled. Advise is to not allow Components Anywhere in components that non-backend users can post content in.

Enable in components Select whether to enable the use of the syntax in components.
Disable on Components Select in which components NOT to enable the use of the syntax in. This is a list of your installed frontend components.
Remove in Disabled Components If selected, the plugin syntax will get removed from the component. If not, the original plugins syntax will remain intact.

Other Areas

These settings have effect on areas outside the component area (so in modules and the rest of the website).

Enable other areas Select whether to enable the use of the syntax in all remaining areas, like the modules. The tag will not be handled/shown in the html head (META tags and such).

Tag Syntax

Component tag The word to be used in the tags.

Note: If you change this, all existing tags will not work anymore.
Tag Characters The surrounding characters of the tag syntax.

Note: If you change this, all existing tags will not work anymore.

Options: {...}, [...], {{...}}, [[...]], [:...:], [%...%]

Advanced

Force Remove tmpl=component Select to remove the tmpl=component from urls inside the rendered component. Only switch this on if you experience issues with urls in the components output generated through Components Anywhere.
Force Itemid Select to force the use of the current Itemid (menu item ID) to the urls inside the rendered component. This might not work with SEF urls.
Keep Component URLs Select to keep the components URLs in the output. Only select this if you find that URLs are not correct.
Pass on Cookies Select to pass on the cookies to the component. Some components need this to function correctly.
Timeout Set the maximum time in seconds that may be used by Components Anywhere to load the component. If you experience Components Anywhere showing nothing, you might want to set this value higher or do something about the servers speed.
Force cURL Select to force Components Anywhere to use cURL to load the components. Only switch this on if you experience Components Anywhere outputting incorrect html.
Use Kerberos authentication Select to use the GSS-Negotiate authentication. This is necessary when using Kerberos authenticated sites.
Login Enter the Kerberos authentication login name.
Password Enter the Kerberos authentication password.
Place HTML comments By default HTML comments are placed around the output of this extension.
These comments can help you troubleshoot when you don't get the output you expect.
If you prefer to not have these comments in your HTML output, turn this option off.

Installation

You can either install Components Anywhere by using the core extension manager available in the Joomla! Administrator Control Panel, or by using the powerful Regular Labs Extension Manager.

Note: When updating Components Anywhere, you do not need to uninstall it first. The package will update all the files automatically.

Keep in mind that when you update to a major new version (or uninstall first), you might lose some configuration settings.

Regular Labs Extension Manager

It is very easy to install/update any Regular Labs Extension using the Regular Labs Extension Manager.

Please see the Tutorial for the Regular Labs Extension Manager for more detailed information...

Joomla! Extension Manager

To install via the Joomla! Extension Manager, just follow these steps:

  1. Log into your Joomla administrator;
  2. In the menu, choose: Extensions >> Extensions;
  3. Choose the tab: Install from Web (or enable it if you haven't done so yet);
  4. Select the search field and enter Components Anywhere and hit enter;
  5. Click on the Components Anywhere listing;
  6. Click on Install;
  7. Click on Install to confirm.
Installer Web

Or if you need to install the Pro version or cannot install via the 'Install via Web' method for some reason:

  1. Download the extension install file (.zip);
  2. Log into your Joomla administrator;
  3. In the menu, choose: Extensions >> Extensions;
  4. Choose the tab: Upload Package File;
  5. Click on the Choose File button and select the extension zip;
  6. Click on Upload & Install.
Installer Upload

If you have problems installing Components Anywhere, please try the manual installation process as described here: docs.joomla.org/Installing_an_extension