Issue With The Page Title And Breadcrumbs Module In The Language School Template On Joomla 5 - Question | JoomShaper

Issue With The Page Title And Breadcrumbs Module In The Language School Template On Joomla 5

marvays

marvays

Template 10 months ago

Dear Support Team,

I am using the Language School template on my Joomla 5 website. The template includes a module for displaying the page title and breadcrumbs. This module works correctly on all pages, except for article detail pages in Joomla.

On these pages, the module is hidden and replaced by the article’s original title, which causes inconsistency in the display. I believe the issue lies in the module incorrectly generating the title for these pages. I would like to fix this and ensure that the same title is used consistently across all pages, including article detail pages.

The problem is that this module is buried somewhere deep within the template, and I cannot easily locate it. Could you please advise me where this module or its logic can be found so I can make the necessary adjustments?

In the attached example, you can clearly see that the breadcrumb path displays correctly within the module, but the page title is incorrect. If I can locate where this module is managed, I could modify it to use the last part of the breadcrumb path as the page title, which would resolve the issue.

For better illustration, here is a link to an example page where the issue occurs: https://j5-tisk-fotografie.richta.eu/realizovane-interiery/zampach

Thank you in advance for your assistance!

Best regards, Martin

0
2 Answers
marvays
marvays
Accepted Answer
10 months ago #178502

After some analysis, I discovered that the generation of the page title in the Language School template is handled by the title.php file located in: /templates/[template_name]/features/

This file generates the page title based on the menu item. However, this logic did not work correctly on article detail pages because the template continued to use the menu item title instead of the article title. To fix this, I modified the renderFeature method in this file to detect when an article is being displayed and to use its title as the page title.

Here is the key section of the updated code:

public function renderFeature()
{
    $app = Factory::getApplication();
    $menuitem = $app->getMenu()->getActive();

    // Get details about the current page
    $input = $app->input;
    $option = $input->getCmd('option'); // Example: com_content
    $view = $input->getCmd('view');     // Example: article
    $id = $input->getInt('id');         // Article ID

    // Default page title
    $page_title = '';

    if ($option === 'com_content' && $view === 'article' && $id) {
        // Load the article title
        $article = \Joomla\CMS\Table\Table::getInstance('content');
        $article->load($id);
        $page_title = $article->title;
    } elseif ($menuitem) {
        $params = $menuitem->getParams();
        $page_title = $menuitem->title;

        if ($params->get('helixultimate_enable_page_title', 0)) {
            if ($params->get('helixultimate_page_title_alt')) {
                $page_title = $params->get('helixultimate_page_title_alt');
            }
        }
    }

    // Set H1 as the default tag for the title
    $page_heading = isset($params) ? $params->get('helixultimate_page_title_heading', 'h1') : 'h1';

    // The rest of the code remains unchanged...
}

What This Fix Accomplished: The page title now displays the article title on article detail pages. The default tag for the title has been set to <h1>, which is correct for SEO purposes. On other pages, the behavior remains unchanged – the menu item title is still used. If you encounter a similar issue, I recommend finding and modifying the title.php file according to the steps above. I hope this solution helps others as well! 😊

0
Mehtaz Afsana Borsha
Mehtaz Afsana Borsha
Accepted Answer
Support Agent 10 months ago #178504

Hi marvays,

Thanks for contacting us and sorry for the delayed reply. Glad to know that you have found the solution and thanks for sharing the solution. You can now close this post by accepting the answer.

-Regards.

0