Home » Extensions » Add to Menu
NoNumber!

Joomla!® Websites & Extensions
development  -  support  -  consultancy

With Add to Menu you can quickly add a menu link to the content item you are editing.

If you use Add to Menu, please post a rating and a review at the Joomla! Extensions Directory.

Description

Add to Menu is an Administrator module. You will get an extra link in the top right of your Administrator to quickly add a menu item link of the page you are viewing.

The link looks like:
Add to Menu

With most of the pages, if you create a new item, you will have to apply/save it before you can see and use this link.

The link will only show up on a page if there is a component template file available for it in Add to Menu.
These component template files are located in:
/administrator/modules/mod_addtomenu/addtomenu/components
More info on how to make extra component templates

 

PS: I know, I know, there is next to no documentation besides what you see here. Sorry... still have to write more on this. If you have any questions, please just ask me via the forum.

Screenshots

Add to Menu icon

Add to Menu - Icon

Add to Menu popup screen

Add to Menu - Popup screen

K2 compatible

Add to Menu - K2 compatible

XML files

Creating component template XML files

Add to Menu is an administrator module that gives you the possibility to quickly add menu items of the item you are viewing at that particular moment.

Add to Menu supports a large number of page types by default. Of course the standard content types (sections, categories, articles, contacts, users, polls, etc) are supported. But also a selection of 3rd party components like FLEXIcontent, K2, MyBlog and RedShop. More will be added in future releases.

If you need the functionality of Add to Menu for a component it does not yet support, you will have to make one or more component template files (xml) for Add to Menu. In this reference guide you will learn how you can do that.

File and folder structure

Once Add to Menu is installed, you can find a folder called 'components' in the Add to Menu module folder (administrator/modules/mod_addtomenu/components).
In this 'components' folder you will see several other folders for the different components. Every folder contains one or more template xml files which Add to Menu uses.

If you are viewing a page in your administrator interface, Add to Menu will search for a folder matching the component (option) of that page. If there is a folder, it will go through the template files contained in that folder. As soon as it finds one that passes the requirements as defined in the 'requirements' section, it will use that component template (and will stop looking further in the folder).

For example, when viewing the administrator url

index.php?option=com_categories&section=com_content

Add to Menu will search through the folder 'com_categories'. And when viewing

index.php?option=com_virtuemart&page=product.product_list

Add to Menu will search through the folder 'com_virtuemart'.

As for file names, it is not too important what you call these template files. You may label them using your own naming scheme, as long as they end in '.xml' (For example, 'category.xml' or 'addcategory.xml'). Add to Menu goes through the files in alphabetical order, so you can use the names to control the order.

Template files

The template file is an xml file containing all the information for Add to Menu to let it know when to show the Add to Menu button, what to show in the modal popup window and with what data it should create the menu item.

In this section all parts of the xml file are explained. There is an example.xml file (in administrator/modules/mod_addtomenu/components/example) which you might want to look into. Also take a look at the already available template files (like for com_content) to see how things are done.

Inside the main <addtomenu> tags you can find general information tags and the <params> tag. Only the information inside the <params> tag is used by Add to Menu. The general information is not necessary, but can help you understand what the template is for and who made it. This also holds the copyright information. Maybe this information can be used in future versions of Add to Menu.

Within the <params> tag, there are 7 sets of information, each affecting the different aspects of creating and storing a link when using the Add to Menu button.

1) Name <name>

This is displayed as the type of menu item in the header of the modal popup window (and in the tooltip). It is best to use the same name as is displayed as menu item type in the 'Select Menu Item Type' list (visible when adding a new menu item to a Joomla menu). But you can name this how you want.

<name>Standard Product Layout</name>

2) Adjust Height <adjust_height>

The height of the Add to Menu modal popup window is dependent on the number of (extra) options. If – for whatever reason – the modal popup window does not get the right size, you can use this tag to adjust it. Positive numbers will increase, negative numbers will decrease the height with so many pixels.

<adjust_height>12</adjust_height>

3) Requirements <required>

This set of values determines whether or not the template should be used on the page.
The parameters and values are checked against the available information. That information can be present in:

  • Request GET (url)
  • Request POST
  • User states

Usually all request parameters are present in the url (GET). But some pages are opened via POST and you will only see index2.php as url. Then you will have to know/find out what parameters and values are passed on to the page. For instance by looking in the html source of the page before (form elements).
The user states are for example values from filters in the lists, like when you select a section from the select box in the article list.

This is the syntax for every parameter and value set.

<parameter>value</parameter>

Multiple values

If multiple values are possible to pass requirements, just separate the values with comma's.

<type>articles,items</type>

Any value

If any value is ok (except empty), use the wildcard '*'.

<cid>*</cid>

If any value except empty, 0 or false is ok, use the wildcard '+'.

<catid>+</catid>

Not present

If you want to check for pages that do not have a certain parameter set, just leave the value empty.

<task></task>

Requirements example

For example, if you want to match an url like:
index.php?option=com_categories&section=com_content&task=edit&cid[]=12
but also match:
index.php?option=com_categories&task=edit&cid[]=34
the requirements are:

  • 'task' should be 'edit',
  • 'section' should be 'com_content' or not set (empty),
  • 'cid' should have some value


The required tag should be:

<required>
<task>edit</task>
<section>,com_content</section>
<cid>*</cid>
</required>

As you might have noticed, 'cid' is enough to match 'cid[]'.

4) Database select <dbselect>

The actual menu item that is created consists of the name, alias, url and extra parameters. The <dbselect> part searches for the name (and alias) that has to be used.

The name can be defined as a generic fixed word.

<dbselect>
<name>Article name</name>
</dbselect>

Add to Menu will create the alias based on the name the way you are familiar with in Joomla. If you want to use a different alias than one based on the name value, you can define it separately.

<dbselect>
<name>Article name</name>
<alias>art</alias>
</dbselect>

But it is of course much nicer if the name (and alias) is grabbed from the name or title of whatever item you are viewing. You can tell Add to Menu where to get this information from the database.

First define which database to search in.

<table>#__categories</table>

Then use the <where> tags to limit the search results to 1 item.
You can use any available parameter values (GET, POST, user states), by preceding it with a '$'. So if you want the id field in the database table to match the cid[] value in the url, use:

<where>
<id>$cid</id>
</where>

And then you can define what table field contains the name (and optionally what field contains the alias).

<name>title</name>
<alias>alias</alias>

So to wrap it up, the full <dbselect> tag in this example.

<dbselect>
<table>#__categories</table>
<where>
<id>$cid</id>
</where>
<name>title</name>
<alias>alias</alias>
</dbselect>

5) Extra options <extras>

This is where you can define extra options to display within the Add to Menu modal popup window. These extra values that the user can select can be used in the final url or in the extra parameters of the menu item.

Each extra option uses an <extra> tag inside the <extras> tag.

First define the label of the option in the <name> tag. This label will be placed before the form element.

<name>Layout</name>

Then set the type of the form element. You can choose from text, textarea, hidden, select and radio.

<type>select</type>

Then you have to define the parameter name. This name can be used later on in the url and extra parameters of the menu item.

<param>layout</param>

And finally you define the value(s) of the parameter.
For element types text, textarea, hidden only 1 value is possible.

<value>1</value>

For element types select and radio, place the <value> tags within a <values> tag. You can have one or multiple <value> tags. Each <value> tag has a name and value defined inside.

<values>
<value>
<name>Category Layout</name>
<value></value>
</value>
<value>
<name>Blog Layout</name>
<value>blog</value>
</value>
</values>

You can also use a <style> tag to add some custom styling to the element.

<style>width:50px;</style>

Here is a full example of what an extra 'Layout' select box would look like.

<extras>
<extra>
<name>Layout</name>
<type>select</type>
<param>layout</param>
<values>
<value>
<name>Category Layout</name>
<value></value>
</value>
<value>
<name>Blog Layout</name>
<value>blog</value>
</value>
</values>
</extra>
</extras>

In this case a Layout parameter will be available. You can use the value (which will either be empty or 'blog') via the variable $layout.

You can also hide/show certain extra fields depending on the value of another. So, for example, if you want to show an extra text field if the user selects 'Blog Layout' from the Layout select field, you can!

The syntax for this show/hide (toggler) option would in this case be:

<extra><type>toggler</type><param>layout</param><value>blog</value></extra>
<extra>
<name>Num Leading</name>
<type>text</type>
<param>num_leading_articles</param>
<value>1</value>
<style>width:50px</style>
</extra>
<extra><type>toggler</type></extra>

The first line is telling Add to Menu that the extra text field should be shown when the 'layout' variable has been assigned the value 'blog', or in other words, if 'Category Blog' has been selected in the select drop down menu. The last line closes the toggler area.

6) URL parameters <urlparams>

Here you can define how the url part of the menu item will be built up. You can use any available variables from the request (GET/POST), user states, but also from the extra options we just discussed.

So you can just define all url parameters (name + value) in the order you need them.

<urlparams>
<option>com_content</option>
<view>category</view>
<layout>$layout</layout>
<id>$cid</id>
</urlparams>

This will result in an url that looks like:

index.php?option=com_content&view=category&layout=blog&id=12

(where layout and id are variable)

7) Menu item parameters <menuparams>

The final part defines what other menu item parameters need to be set. Again, you can use all available variables from the request (GET/POST), user states and the extra options.

You'd need to find out the parameter names for the menu item and then assign the values in the same way as is done in the rest of the template.

The parameters you can set can be found in the xml file that of the actual component view. For example, in the folder components/com_content/views/category/tmpl, the parameters for the Standard Category layout are stored in the 'default.xml' file, while the ones for Category Blog layout are in the 'blog.xml' file.

Another way you can find the available parameters id to look in the html output of the menu item edit page.

The third option is to look in the menu table in the database. The parameters are stored in the params field.

An example of what the <menuparams> set might look like.

<menuparams>
<num_leading_articles>$num_leading_articles</num_leading_articles>
<num_intro_articles>$num_intro_articles</num_intro_articles>
<num_columns>$num_columns</num_columns>
<num_links>$num_links</num_links>
</menuparams>

You will find what parameters are available and the possible values you can assign to them for the component in the XML file of that component's view, as the params are actually the names given to each parameter in the XML file.

FAQ's

I have a new article (or section or category), but I don't see the Add to Menu link?

  • Correct!
    The Add to Menu link will be available as soon as you apply/save the content item.

Does Add to Menu also work on K2, SOBI, Joomsuite Resources, ...?

  • It can potentially work on all components
    Add to Menu has a components folder where you can put your own 'templates' for extra support.
    At the moment it already comes with component templates for all the Joomla! core content types, users, K2 and MyBlog.
    These component template files are located in:
    /administrator/modules/mod_addtomenu/addtomenu/components
    More info on how to make extra component templates

Specs

Specifications

Add to Menu is a Joomla extension compatible with Joomla 1.5, Joomla 1.7 and Joomla 2.5.

The extension consists of:

  • an administrator module

Requirements

Add to Menu will only work correctly if your setup meets these requirements:

  • Up-to-date version of Joomla!
  • PHP 5.3+
  • PHP mbstring (Multibyte String) functions should be enabled
  • MySQL 5+

Using PHP 5.2 (or lower)?
PHP 5.2 is old and support for it has stopped with the release of PHP 5.2.16 (16-Dec-2010). This means that PHP 5.2 cannot be considered stable or secure anymore.
If your host will not or cannot provide you with an up-to-date version of PHP, then you have reason enough to look for a decent host.
PHP 5.2 mainly has problems with installation of the zip packages. The extensions might work without problems for you once installed, but I can not give any guarantees on that.
>> For more detailed information, read: No more php 5.2 support - move on to php 5.3

I can not provide support for setups that do not meet the above requirements.

The core Joomla files should of course not be altered in any way.

Installation

The easiest way to install/update is via the NoNumber! Extension Manager.

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

Otherwise, please report this on the forum or let me know via the contact form.

Updating

If you want to update to the latest version, you do not have to uninstall first.

The easiest way to install/update is via the NoNumber! Extension Manager.

You can also update simply by installing the package via the Joomla core installation process.

Downgrading

If for some reason you need to downgrade, it is best to uninstall the extension first.

Also, you will have to uninstall the NoNumber! Framework plugin (system) (and the NoNumber Elements plugin if you have it installed).

After that you can simply install the older version zip file.

Please note that I cannot not provide support on older versions!

Open Source License

Add to Menu is an Open Source Joomla extension. It is in compliance with the GNU/GPL license:
Licence: GNU/GPL GNU General Public License, version 2

Joomla is also Open Source.

Support

Need more help?

Before requesting help, make sure your installation and setup meet the requirements (see the Specs) and your extensions are up-to-date.

If you need more help, please take a look in the NoNumber! Forum.
If you can't find your answer there, please post your question. I am very willing to help!

You can also contact me via the contact form or via chat (if I'm online).

Changelog

Changelog

+ = Added ! = Removed ^ = Changed # = Fixed

10-Jan-2012 : v1.9.6
# Fixed issue with access to popup being denied to certain groups (Joomla 1.7+)
# Fixed issue with installer not removing the folder/zip from the tmp

09-Jan-2012 : v1.9.5
^ Updated translations: nb-NO
# Fixed issue with title with quotes being stripped

23-Dec-2011 : v1.9.4
# Fixed issue with assignment options not showing on mootools 1.2+ setups

22-Dec-2011 : v1.9.3
# Fixed issue with button not showing up on article edit pages (Joomla 1.5)

21-Dec-2011 : v1.9.2
^ Updated translations: fr-FR
# Fixed issue with menu items created in top level not having correct level assigned (Joomla 1.7)
# Fixed issue with styling of the admin status module
# Fixed issue with errors on duplicate aliases being unreadable

05-Dec-2011 : v1.9.1
# Fixed issue with core search pages not working because of !NoNumber! Framework

01-Dec-2011 : v1.9.0
+ Joomla 1.7 compatible!
^ Updated translations: es-ES
^ Cleaned code syntax (no longer guaranteed support for php 5.2.x and lower)

08-Oct-2011 : v1.8.1
# Fixed security issue in !NoNumber! Framework plugin

08-Oct-2011 : v1.8.0
^ Improved installer
^ Moved translation language files to main package (no more language packs)
^ Cleaned up some code (like no more use of DS)
# Fixed issue with non-translated strings showing on non-English setups

16-Sep-2011 : v1.7.0
+ Added check to see if there is a component file inside the specific components folder
+ Added options to adjust modal popup size
^ Made popup a little wider
^ Changed way !MooTools version is detected
^ Changed !NoNumber! Elements plugin to !NoNumber! Framework
^ Moved common language strings to !NoNumber! Framework files

25-Mar-2011 : v1.6.1
^ Changed language files to be J1.6 ready

10-Feb-2011 : v1.6.0
^ Changed extension icon / logo
# Fixed issue with public access to popup page (security fix!)

11-Dec-2010 : v1.5.1
# Fixed issues with document being called to early
# Fixed some issues with loading of language strings
# Cleaned up some code

25-Nov-2010 : v1.5.0
+ Added checks to see if !NoNumber! Elements plugin is installed/enabled
^ Fixed and updated all language strings
^ Changed display of menu item list
# Fixed issue with toggle script for extra options not working

16-Nov-2010 : v1.4.0
^ Made !MooTools 1.2 compatible

28-Sep-2010 : v1.3.0
+ Added component files for redShop
+ Added ability to change the text shown as link in the status bar
+ Added a tooltip that shows some info on the link that will be added
+ Added extra blog settings for categories / sections
+ Added possibility to show/hide extra options depending on a fields value
+ Also checks cookies for selected filters
^ Changed component files from php to xml
^ Improved overall code
# Fixed a few component files

24-Jul-2010 : v1.2.4
^ Changed way version and license information are displayed (now via ajax)
^ Changed way versions and licenses are checked (no more base64)
# Fixed issue with button not showing when used i.c.w. some other extensions

22-May-2010 : v1.2.3
# Fixed issue with syntax errors in xml files (causing problems in admin module manager)

13-May-2010 : v1.2.2
# Fixed issue with button not showing on all !FLEXIcontent article / category pages
# Fixed issue with errors about registry for php 5.0.5

09-Feb-2010 : v1.2.1
# Fixed location of Joomla! DTD files
# Fixed issue with deprecated syntax for php 5.3+

18-Jan-2010 : v1.2.0
^ Moved elements to separate global plugin (also used by other extensions)
^ Changed the License Code check (now controlled by the License Manager)
^ Made requirements array smarter to match components

Commercial License

Add to Menu is completely free and you DON'T need a Commercial License Code to use it.

However, if you use my extensions on websites that you make money from, I would appreciate it if you purchase a License Code.
The License Code will remove the license message from the extensions administrator screens.

Note: If you don't want to pay for the License Code and want to continue to use the extension for free, please do. You will just have to ignore the license message in the administrator.

Note: If you have donated before and feel you should get some reduction on the price, please contact me about it... we'll sort it out :)

more information...

 

 

Here you can see the difference between the use of the extensions without and with Commercial License Code.

WITHOUT Commercial License CodeWITH Commercial License Code
Full version download yes YES yes YES
Full functionality yes YES yes YES
Message in administrator license_invalid license_valid
Encrypted no NO no NO
Free updates yes YES yes YES
Free support yes YES yes YES
Free RSS news subscription yes YES yes YES
Free holiday to Barbados no NO no NO

Download

Downloads

Add to Menu is compatible with Joomla 1.5, Joomla 1.7 and Joomla 2.5

NOTE: Add to Menu needs PHP 5.3+. Please see the specs for more requirements.

  • Are you going to use this extension on a commercial website? Please consider buying a License Code

More downloads...

Please clear your browsers cache after updating an extension.

NOTE: Joomla 1.6 is no longer supported. Joomla 1.6 reached end-of-life in August 2011. If you have a site running on Joomla 1.6 you are urged to upgrade to Joomla! 2.5. Add to Menu will probably still work on Joomla 1.6, but any issues specific to Joomla 1.6 will not be fixed.

Tip!

Are you using multiple NoNumber! extensions?
Install the NoNumber! Extension Manager to easily keep them up-to-date.

Languages

This extension comes with the following languages:

  • [ar-SA] Arabic
  • [bs-BA] Bosnian
  • [pt-BR] Brazilian Portuguese
  • [bg-BG] Bulgarian
  • [ca-ES] Catalan
  • [da-DK] Danish
  • [nl-NL] Dutch
  • [en-GB] English
  • [fr-FR] French
  • [de-DE] German
  • [el-GR] Greek
  • [it-IT] Italian
  • [ja-JP] Japanese
  • [lt-LT] Lithuanian
  • [nb-NO] Norwegian
  • [pl-PL] Polish
  • [ro-RO] Romanian
  • [ru-RU] Russian
  • [sr-RS] Serbian
  • [sl-SI] Slovenian
  • [es-ES] Spanish
  • [sv-SE] Swedish
  • [th-TH] Thai
  • [uk-UA] Ukrainian

No language pack for your language?

I welcome you to help out and get involved with translations for NoNumber! extensions.

I am using Transifex for the translations of all NoNumber! extensions. So I kindly ask you to join Transifex.

There is a translation team/group set up especially for Joomla projects: OpenTranslators.

To join, see the different steps on the right under: Translator Guide: http://opentranslators.org/en/how-to

You can find all the NoNumber! projects here: https://www.transifex.net/projects/tag/nonumber/

All language files will be updated and packed with every new release of the individual extensions.

OpenTranslators

 
MaxCDN | Content Delivery Network | Accelerate your site to the max
Open Source Training | Online Joomla! Training and Support
hosting joomla