Get a Free Quote

We respect your privacy

Using special characters in the menu items in Joomla

6:47 am

Using special characters in the menu items in Joomla

Screenshot from 2014-08-01 12:13:31

There are times when you need to include characters to the titles in your menu items. This should be ideally possible. But at times when you do place special characters on the menu they don’t appear correct on the user end. What ends up being displayed is the HTML code of the special character. For example at times when you add the special character ‘&’ what actually appears on the website is ‘&amp’. This is minor issue that has the possibility of destroying the look and feel of your website and hence should not be taken lightly.

Thus this issue needs to be solved and it can be done by following the simple instructions provided below.

  • To start with login to you web server via FTP.
  • Once logged in navigate to the directory modules/mod_menu/ and download the file helper.php.
  • Now open this file I your favorite editor.
  • You need to use the powerful search features present in your editor to search for the following section of code.                                                                                                                                      $item-.title = htmlspcialcharacters(item->title);
  • Once you do find the code above add a few lines above it and add the next few lines above it.        $item->title = str_replace( array(‘&lt’, ‘&gt’, ‘&amp’), array(‘<’, ‘>’,’&’, ), $item->title);
  • Here the first array consists of a list of predefined character codes and the second array contains the symbols of the predefined code.
  • In this case your system will allow you to now enter the special character ‘&’ with ease. However if you wish to add additional special characters you need to do so in a similar way. First get the predefined character codes for the predefined symbol and follow the same procedure as we mentioned above to ‘fix’ the website.

You will now have the ability to add special characters to you menu titles with ease. Joomla in general is quite easy to use. It is likely that you may require the help of a professional Joomla web developer initially to set up you website, but it is easy for you to maintain the website yourself. The user interface is so easy that you may be able to even add addition functionality in the form of modules to your website.

 

1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 1.00 out of 5)
Loading...Loading...

Comments are closed.