1

I would like to add the following code to over 50 articles:

Is there a way to add the code to my articles in one shot? I attempted to do this with the Batch Process, but the functionality didn't exist.

Any help will be appreciated.

Cheers

Carlton

| improve this question | | | | |
  • 1
  • what is the following code? is it code or content? – FFrewin Jun 27 '16 at 16:10
  • Hi FFrewin, I have decided to give regularlabs a try. However, each time I attempt to install the application I get the error message 'Unable to find install package'. – Carltonp Jun 27 '16 at 18:01
  • I'm also getting the following error: JFolder::create: Path not in open_basedir paths. – Carltonp Jun 27 '16 at 18:27
  • 1
    Is there a relation between those 50 articles, like they are all in the same category? If so, you could create a template override for the article layout and do a conditional where if catid=101, then add code. – YellowWebMonkey Jun 28 '16 at 21:47
1

The best thing to do is to create a module and then assign that module to all your pages, and then, in your template file (the index.php file), make sure you display the module only when you are in an article. You can check if you are in an article the following way:

$jinput = JFactory::getApplication()->input;
$option = $jinput->getCmd('option');
$view   = $jinput->getCmd('view');
if ($option == 'com_content' && $view == 'article'){
    // We are in an article. Add the module tag here.
}
| improve this answer | | | | |
  • @ffrewin, as you know, I have finally managed to install regularlabs, however the ability to add code to a number of articles in one shot using DB Replacer can only be achieved by replacing code. This isn't really what I would like. I would just like to add code to a number of articles without having to replace code. – Carltonp Jun 28 '16 at 14:59
  • 1
    I take it back the Regular Content Templater does the trick. Thank you – Carltonp Jun 28 '16 at 15:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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