3

I'm using joomla 3.3.6 and I designed content page as I want, but I need one more thing.
Is there a plugin or a component to display all/other articles as a list, so the user can move to them. The final content page should have the content to read, and below a list of other suggested articles.

I searched a lot about the subject, but I didn't have any luck to find what I want.

==============

I thought in another way: Is it possible to get articles from the database table using JFactory::getDbo() and display them in article view, and how?

Please advice...

2 Answers 2

2

Yes you could create an override in the article view template file, and make a call to the db to fetch articles and display them.

But maybe it would be better to use an article module for this. If your template has a module position below the component (content) location, you could assign it there. If it doesn't then you could create a new one.

If showing the module in a module position is not what you want, it's also possible to make the module load inside the article.

You can always load modules inside an article, with the {loadposition positionx} - with the Content Plugin - Load Modules being enabled.

If you want all articles to include the module, and being tired with the process of manually adding the module to each article, then you could create an override for the article view and have the module loaded dynamically.

Create a template override for the article and use anywhere you like, guess you want it after the article content, so that would be somewhere after:

$this->item->text;

Code to load module inside the article template:

   <?php 
   jimport( 'joomla.application.module.helper' );

    $modules = JModuleHelper::getModules( 'articlebottom' ); // Get Modules assigned at a position articlebottom (Returns and array)- it can be a custom position. 

    $attribs = array('style' => 'xhtml'); // define module attributes, like module chrome. 

    if (count($modules)>0) { // Checking if there are modules ?> 

        <!-- Module wrapper -->
        <div id="top-contentb" class="top-content">

            <?php echo JModuleHelper::renderModule($modules[0], $attribs); // Render the first module of the $modules array.?> 

        </div>

*You can find more info about creating template overrides in here and in Joomla.org.

Finally, it worths checking in Joomla Extensions Directory for articles extensions - apart of the modules, there could be content plugin that can load articles suggestions (like similar articles, recent articles, category articles etc).

0

That would be a module. There are already related and recent articles modules in the Joomla! and extension directory has plenty more. You will probably be able to find something to fit your particular need. (I don't really understand what kinds of articles specifically you want to show and how, and the correct module depends on that, so I can't be more specific.)

3
  • No I need to display the articles in the article view so modules will not help I guess, I need to display other articles linkable titles without conditions
    – Ya Basha
    Mar 14, 2015 at 13:56
  • Why does article view make modules useless? (Trying to understand what you want more precisely.) Mar 14, 2015 at 16:18
  • surely you could use mod_articles_category and show all articles in category on each page for the component ? Apr 16, 2015 at 8:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.