Marco's Blog

All content personal opinions or work.
en eo

What is moscontentlink?

2005-05-04 2 min read Joomla marco

Just after I finished moszoomimglink, I created another useful mambot. This one allows you to add a link to any content on your site, provided you know its title.

To use it, the syntax is very simple:
  • { moscontentlink:’Item’ }

  • { moscontentlink:’Item’|’Alternate text’ }

    [Using Ids]

For example, if you want to add a link to this section (id=378 , title = What is moscontentlink?), you would have to enter:

{ moscontentlink:#378# }

Example: {moscontentlink:#378#}

[Using Full Titles]

Alternatively, you can use the full title:

{ moscontentlink:What is moscontentlink? }

Example: {moscontentlink:What is moscontentlink?}

[Alternate Text]

If you want to use the alternate syntax, you can change the text that is displayed to whatever you want, provided neither the title nor the alternate text contain the pipe simbol, ‘|’:

{ moscontentlink:What is moscontentlink?|moscontentlink article }

Example: {moscontentlink:What is moscontentlink?|moscontentlink article}

[Approximate Matches]

Notice that you can have approximate matches using the SQL ‘%’ syntax. So I could say:

{ moscontentlink:%moscontentlink%|some article about moscontentlink }

Example: {moscontentlink:%moscontentlink%|some article about moscontentlink}

In this last case, you will get a random article on the title you specified, if there are more than one.

[Menu Link]

moscontentlink will automatically detect whether there is a menu item linked to this particular content item, and automatically add the correct menu link. In this case, you will not only see the content item, but the correct location in the main menu, too.