what is the code to route the urls to flexi content items ?

More
6 years 3 months ago #74482 by tataye
Hello,
on a flexi site, I use accordion menu ck, wich can generate links to articles automaticaly generated.

one of them, for instance is :
  plantes-et-eaux.weblor.fr/index.php/comp...angements?Itemid=101
it goes to an error page
the right url should be : 
plantes-et-eaux.weblor.fr/index.php/docu...et-leurs-changements

same thing with items and categories

could you tell us what should be the routing code as the developper should involve his extension to propose flexicontent option ?

thanks
Serge

Please Log in or Create an account to join the conversation.

More
6 years 3 months ago #74484 by ggppdk
Hello

there is only 1 good way to replace URLs

these URLs that you mention are contained in the HTML of some page,
inside a component view (e.g. Joomla category view) of the page or inside a module of the page

- either create a Joomla template override of the module
- or create a Joomla template override of the view, e.g. of Joomla category view
- ... or an override of the Joomla layout file, if these are created in a layout file

and replace call to Joomla Router with calls to Flexicontent router

at the top of the override add:
Code:
require_once (JPATH_ADMINISTRATOR.DS.'components'.DS.'com_flexicontent'.DS.'defineconstants.php'); require_once(JPATH_SITE.DS.'components'.DS.'com_content'.DS.'helpers'.DS.'route.php'); require_once(JPATH_SITE.DS.'components'.DS.'com_flexicontent'.DS.'helpers'.DS.'route.php');
then for every link like:
Code:
... = JRoute::_(ContentHelperRoute::getArticleRoute($item->slug, $item->catid, $item->language));
Code:
... = JRoute::_(FlexicontentHelperRoute::getItemRoute($item->slug, (!empty($item->catslug) ? $item->catslug : $item->catid), 0, null));


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
6 years 3 months ago #74485 by ggppdk
Hello

also here is a FAQ article with more info
flexicontent.org/documentation/faq/70-de...-in-custom-code.html


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.963 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline