BlackFire27
BlackFire27

Reputation: 1560

looking for a joomla function to display an article

I have got this function.

 function onContentAfterDisplay( $article, &$params, $limitstart)
 {
     if(!is_home() && is_single){
         return "<script src='http://widget.eya.com/sprk.1.0.2.js' type='text/javascript'></script>"; 
     }
   return '';
 }

I want to return that tag only if there is a single article and nothing else. In wordpress I know it can be done with the function is_single... in joomla , I am not sure that there is. Is there a way to identify if there is a single article per page?

Upvotes: 0

Views: 151

Answers (1)

Irfan
Irfan

Reputation: 7059

You can check for view condition that the view should be article.

function onContentAfterDisplay( $article, &$params, $limitstart)
 {
    $view= JRequest::getVar('view','');
 if($view=='article'){
         return "<script src='http://widget.eya.com/sprk.1.0.2.js' type='text/javascript'></script>"; 
     }
   return '';
 }

Upvotes: 1

Related Questions