J3.8.3 - Trying to display article title in a module

General questions relating to Joomla! 3.x. Please consider the availability of third-party templates and extensions when deciding which Joomla version to use.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
Post Reply
webguy101au
Joomla! Apprentice
Joomla! Apprentice
Posts: 25
Joined: Fri May 16, 2008 7:32 am

J3.8.3 - Trying to display article title in a module

Post by webguy101au » Sun Jan 14, 2018 5:19 am

Hi team.

I am trying to create a module to display the loaded articles title, in the module, not in the article itself. Under the menu item that displays a single article, I have disabled showing the article title.

Now, to use PHP, I an using sourcer from regular labs. Have used it in other sites and seems to work well.

I have tried a couple of different chunks of code I have come across, this is the last one I am trying and I get no text / title appear at all.

{source}
<?php
$app = JFactory::getApplication();
$post = JTable::getInstance('content');
$post->load( $app->input->getInt('id') );

echo $post->get('title'); // display the article title
?>{/source}

Has J3.8.? changed the method again?

Does anyone see anything wrong with that code? Any help much appreciated.

webguy101au
Joomla! Apprentice
Joomla! Apprentice
Posts: 25
Joined: Fri May 16, 2008 7:32 am

Re: J3.8.3 - Trying to display article title in a module

Post by webguy101au » Sun Jan 14, 2018 5:27 am

All good, sorted it all out.


Post Reply

Return to “General Questions/New to Joomla! 3.x”