Breadcrumbs

Home Technical Help Auto publishing of articles in Joomla
Auto publishing of articles in Joomla PDF Print E-mail
Written by Administrator   

If you want your Authors to be able to publish articles default when saved or auto publish articles so that they appear in your site immediately, you need to hack some of the Joomla core code. Do the following:

 

Navigate to /components/com_content/models/article.php

 

Find

 

if ($isNew)

{

// For new items - author is not allowed to

publish - prevent them from doing so

$article->state = 0;

}

else

{

 

Change

 

$article->state = 0  to $article->state =1 ( around Line 333)

 

If this doesn't work you may need to change a second file. Navigate to \components\com_content\controller.php

 

Find

 

if ($access->canPublish)

{

// Publishers, admins, etc just get the stock msg

$msg = JText::_('Item successfully saved.');

}

else

{

$msg = $isNew ? JText::_('THANK_SUB') : JText::_('Item

successfully saved.');

}

 

then comment out all of the above lines with "//"

 

// if ($access->canPublish)

// {

// // Publishers, admins, etc just get the stock msg

// $msg = JText::_('Item successfully saved.');

// }

// else

// {

// $msg = $isNew ? JText::_('THANK_SUB') : JText::_('Item

successfully saved.');

// }

 

Note* Usually changing the first file article.php is enough