Changing Joomla article links to be FLEXIcontent item links

  • Published by
    George Papadakis
  • Last modified
    28 November 2017
  • Up to date
    Yes
  • Concerns
    Component Modules
  • Since Version
    3.X
  • Voting
    Average rating
    • 1
    • 2
    • 3
    • 4
    • 5
  • Favourites
    626 Changing Joomla article links to be FLEXIcontent item links /documentation/tutorials-english/75-basic-usage/626-changing-joomla-article-links-to-be-flexicontent-item-links.html

A Joomla template override can be created in order to change Joomla articles to be FLEXIcontent item links:

[b]example for template files of the modules[/b]

  1. Copy:
    modules/mod_MMMM/tmpl/somename.php
    to:
    template/ACTIVE_JOOMLA_TMPL/html/mod_MMMM/somename.php
  2. Then at the top of somename.php,  add:
        require_once (JPATH_ADMINISTRATOR.'/components/com_flexicontent/defineconstants.php');
        require_once (JPATH_SITE.'/components/com_flexicontent/helpers/route.php');
  3. Replace links:
    <a href="/<?php echo $item->NNNN; ?>">

    with:
    <a href="/<?php echo JRoute::_(FlexicontentHelperRoute::getItemRoute($item->id, 0, 0, $item)); ?>">

    if the "slugs" are available then the above should be:
    <a href="/<?php echo JRoute::_(FlexicontentHelperRoute::getItemRoute($item->slug, $item->categoryslug, 0, $item)); ?>">

    to see what is available (temporarily) do:
    echo "<pre>";
    print_r($item);
    exit;