I am very new to Joomla. I started 4 days ago. Does anybody know an easy and not very time consuming way to use the article like a template, defining variables that could substitute simple strings. We have several sites and those site have different language versions that have {BRAND NAME} translated to many languages, and we would like to be able to replace this with the relevant brand name inside the article. This could be also very useful in case the brand name changes slightly so we won't have to edit every article again.
2 Answers
I'm not 100% sure I understand what you are doing, but NoNumbers ReReplacer seems to do something like what you want. Here is what is written about ReReplacer on their site http://www.nonumber.nl/extensions/rereplacer/userguide
ReReplacer enables you to search and replace virtually anything in your website on-the-fly.
It functions on the HTML level of your website, so you can replace any piece of HTML you can find.
You can search for stuff and replace it with something else. Or remove it (by replacing it with nothing). ReReplacer supports powerful Regular Expressions.
-
Thank you very much for your recommendations. I have ended up using the ReReplacer extension. I have found this to be very useful and versatile– Mg GmCommented Jun 25, 2014 at 8:09
-
NoNumber is one of the best, if not the best, components in all of Joomla!. Highly recommend you see what it can do for you, if you're getting into the Joomla! world. And getting pro is 100% worth it a thousand times over.– FayeCommented Jun 25, 2014 at 15:50
-
@MgGm I'm glad you found it useful:) On a slightly different note, if my post answered your question, please mark it as the answer. Thanks :) Commented Jun 26, 2014 at 11:16
In Language Manager, you can define Label Overrides. E.g. MYLABEL_A_VARIABLE "This is a test".
To render Language Labels (there are several ways), in an article, I prefer to install NoNumber Sourcerer http://www.nonumber.nl/extensions/sourcerer:
This is a simple article to show a {source}
<?php
echo JText::_('MYLABEL_A_VARIABLE');
?>
{/source} variable.
And if you use Sourcerer and place that code in a snippet using NoNumber Snippets, you can actually call the code block in your article using this format: {snippet brandnameX} which keeps your articles nice and clean.