How to use Link Provider

From TomatoCMS Documentation

Jump to: navigation, search

In TomatoCMS, there are many places we have to insert the links, for example:

  • Add a banner to a page
  • Set the link for menu item
  • Set the link for sitemap item

Link Provider is machine that allows you to input the link in more easy and friendly way.
To use the Link Provider, please perform the following steps:

Install hooks

These hooks provides the links associating with module.
Click on System / Extend / Hook menu, from the left side, click on news module.
Click on Install button in articlelinks hook section:

File:linkProvider_install_hook.jpg

Repeat the steps above to install the pagelinks hook from page module.

Apply the hooks

Click on System > Hook Target menu, look for Core_LinkProvider target from core module.
From the list of available hooks, select articlelinks then click on Add link to apply this hook for Core_LinkProvider target.

File:linkProvider_apply_hook.jpg

Repeat the steps for pagelinks hook.

Test the Link Provider

To check whether Link Provider works or not, for example in Menu module, please:

  • Click Modules > Manage Menu > Build new menu menu.
  • Click on the You can use the Links Provider to input the URL quickly link
  • Now, you can see the list of links divided into different groups

For instance, click on List articles in same category group, you can see the list of categories and links to them.
Click on any category, and if you see the category's link and label were added as new menu item, our Link Provider works as expected.

File:linkProvider_test_hook.jpg

Personal tools