Link Manager

Over a number of years, components for Joomla became more and more powerfull, but at least no one of them allows a dynamic link creation to simplify the work of the administrator. Imagine, you have now a powerfull tool to do this. Just define the parameters in the Link Manager and get the link anywhere you want in your themplate with just one line of code.

NOTE

Creating own or changing the standard links needs some knowledge about how the Joomla linking system works. Don't matter about that. At the end of this section you will find some examples how to create/change links in Joo!CM.

Link Manager List

This list shows you all links used in Joo!CM. At its core, there is a number of predefined links which can be changed and of course added if there is a need for this.

Link Manager Edit

  • Name. The name for the link. It's just for descriptive purpose.
  • Component. The name of the component you want to call.
  • URL. Further URL parameters.
  • Function. A unique name indicating the function of this link.
  • Published. Indicates whether the link is published or not.
  • Replacement. In this field you are able to replace variable names.

Frontend Using

Did I mentioned you need only one line of code to get the whole link? Maybe it was just marketing. In fact you need two lines of code, because you have to publicize the Joo!CM framework first. You can do this by implementing the following code into you application.

<?php require_once(JPATH_SITE.DS.'components'.DS.'com_joocm'.DS.'include.php'); ?>

After the Joo!CM framework is known, you can now create the link.

<a href="<?php echo JoocmHelper::getLink('editprofile'); ?>">Edit Profile</a>

Experienced Joomla users may now ask, why not just do something like this:

<a href="<?php echo JRoute::_('index.php?option=com_joocm&view=editprofile'); ?>">Edit Profile</a>

In fact, the result is the same and it is an alternative if you want to use it once in your template. But… What about changes? What if you need to change the parameters because the software you are using to edit the profile changed or you just want to use other profile editing component? And what about, when you use this link on more then one view? Yes! You need to edit your template file(s). So it's more efficient to make changes in the backend just setting up the parameters once.

Example For Third Party Components

Private Message System

Joo!CM has already implemented links to send private messages in its template. All you have to do is to add a link in the Link Manager.

Example using uddeIM

  • Name: Send Message
  • Component: com_uddeim
  • URL: &task=new
  • Function: sendmessage
  • Published: Yes
  • Replacement: id=recip

So, now it's time to describe the replacement field. Joo!CM is creating the link with the variable name “id” for the user id, but uddeIM expects the variable name “recip” as the user id. That's the magic.


 
  • Recent changes RSS feed
  • joocm/link_manager.txt · Last modified: 2010/05/12 14:48 by Robert Stemplewski