Directing mod_mostread to display flexicontent categories

More
14 years 11 months ago #1814 by neubjr
I'm using the mod_mostread core joomla module to display the most active articles on my site. I edited this module to also include a link to the category of the articles.

The original link to the article automatically redirects to the com_flexicontent address; however, when I added the link to the category it is still using the com_content address. How do I change this to link automatically to the com_flexicontent category view?

I edited the function in the mod_mostread helper.php to read the following:
Code:
foreach ( $rows as $row ) { $lists[$i]->link = JRoute::_(ContentHelperRoute::getArticleRoute($row->slug, $row->catslug, $row->sectionid)); $lists[$i]->text = htmlspecialchars( $row->title ); $lists[$i]->catlink = JRoute::_(ContentHelperRoute::getCategoryRoute($row->catslug, $row->sectionid)); //edited for trying to get Popular to display the category link $lists[$i]->hits = $row->hits; $lists[$i]->catid = $catid; $i++; }
so that it passes through the category link and displays it in the default.php with this:
Code:
<?php foreach ($list as $item) : ?> <li class="mostread<?php echo $params->get('moduleclass_sfx'); ?>"> <a href="<?php echo $item->link; ?>" class="mostread<?php echo $params->get('moduleclass_sfx'); ?>"<?php if($params->get('showhits')) echo ' title="'.$item->hits.' '.$params->get('hitstext').'"'; ?>> <?php echo $item->text; ?> ( <a href="<?php echo $item->catlink; ?>" class="mostread<?php echo $params->get('moduleclass_sfx'); ?>"> category <?php echo $item->catid; ?> ) </li> <?php endforeach; ?>

I basically just copied the code the way the mod_mostread file was already doing it, assuming it would be automatically redirected to flexicontent like the article address is.

What am I doing wrong so that its not kicking in the Flexicontent category view?

I'm very new to the php/sql thing, but trying to learn, so thanks for any ideas.

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

More
14 years 11 months ago #1969 by bsky92
Hi

All the mod using com_content are not really working with Felxicontent, but Emmanuel is working on a Felxicontent module that will solve all these problems

This module should be realeased soon, so I decided to wait for the release instead trying to fix it :)

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

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.527 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