B
B
BLOGG2019-10-14 17:42:04
Joomla
BLOGG, 2019-10-14 17:42:04

Where in Joomla menu links are displayed, in what file?

Hello to all web knights!
I want to make micro-markup for the site, namely, add the itemprop attribute for menu links.
Found where they are displayed
. They are in the mod_menu folder, the default.php file.
But there are no links there.
Found where these links are requested. This is a line in the default_component.php file in the same folder, namely the line:
echo JHtml::_('link', JFilterOutput::ampReplace(htmlspecialchars($item->flink, ENT_COMPAT, 'UTF-8', false)) , $linktype, $attributes);
But where the code is located is still unknown. I've already searched through all the files on the site, but if you search through "href" or < a > (without spaces), then there are too many files.
Please help me find the file where the menu links are displayed.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
P
Pavel Gruznykh, 2019-10-15
@pavelcarcass

Read here , it seems that you need to register your attribute in the default_url.php file.

A
Anton R., 2019-10-14
@anton_reut

Often there is a menu.php file in the template folder.

P
Pavel, 2019-10-16
@3axap_90

the default.php file can be rewritten like this

<?php
defined('_JEXEC') or die;
$menu = JFactory::getApplication()->getMenu();
?>
<ul>
  <?php foreach ($list as $i => &$item): ?>
    <li><a href="<?php echo $item->flink;?>"><?php echo $item->title;?></a></li>
  <?php endforeach;?>
</ul>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question