The {show} / {hide} tags are not being converted
The Conditional Content plugin is not published
Check if the Conditional Content plugin is published. Go to Extensions >> Plugin manager and search for the system plugin System - Regular Labs - Conditional Content. Then publish it.
There is markup on the plugin tags
If you have copy/pasted code directly into your editor, you might also have copied along hidden HTML tags. So this will also cause the {show}
/ {hide}
tags to break:
{<span>show</span> ...}
Remove the extra styling or other html tags around and in the tags that might cause problems.
How safe is the hiding of the content?
Anything that is entered between the {show}
/ {hide}
tags is processed before the final html of the page is rendered.
This means that when the conditions do not pass, the desired text will be hidden completely and will NOT be visible in any way in the final html output of the page.
The {show} / {hide} tags are seen in the Search component
The Joomla core Search component searches directly on the content in your database. So not in the final content as visible on the frontend (which is affected by plugins).
You should instead use Smart Search which is better, as it indexes your website as it loads on the frontend for visitors.
There are also some 3rd party search components out there that might do a better job.
How does caching affect Conditional Content?
Depending on how you set up caching in your Joomla setup, the content in which you place the {show}
or {hide}
tags can be cached too.
This may have an undesired affect on what content is shown. This also depends on what conditions you use.
Joomla generally caches pages on a page (url) and language level. So it should not matter when that content is cached, Conditional Content will still output what you expect.
For other conditions, you might want to change some stuff in how the content is cached.
When using the Conditional Content tags in a module, you could for instance switch off the caching for that module.
In some 3rd party caching extensions you can also switch off caching for certain scenarios.
How to prevent the URL condition also matching urls you don't want
The URL condition will match any url that contains the part you place in the URL assignment field.
For instance, if you place foobar=1
in that field, it would match any of these urls:
index.php?foobar=1 index.php?foobar=1&baz=qux index.php?foobar=10 index.php?baz=qux&foobar=123
Let's say you only want it to match the first 2 urls, but not the other 2 that have a number starting with a 1 but are not 1.
The solution is to use Regular Expressions.
In this case you want the assignment to only match urls containing foobar=1
but is either followed by something other than a number or is at the end of the url.
In that case, this assignment should work (with the Regular Expressions option on):
foobar=1([^0-9]|$)
To explain:(...|...)
match any of these possibilities.[^0-9]
match any character that is not a number.$
match the end of the string.
More on Regular Expressions
For documentation on regular expressions, check out the Regular Expressions Cheat Sheet.
For more info on Regular Expressions: http://www.regular-expressions.info/reference.html
For testing them: http://gskinner.com/RegExr, http://regexpal.com, http://www.phpliveregex.com
I want to use a condition for something that is not available
If you are using the FREE version, see if the condition is available in the PRO version.
In the PRO version there is also the ability create a condition using custom PHP code. This gives you the opportunity to show/hide your content based on just about anything you can think of. You just need to know what PHP code you should use.
With PHP you can call on all data/information available in the variables, url, database, etc. And then do your checks on this data. You can tell Conditional Content to show/hide the content by ending the PHP code with a return true or false based on your checks.
For examples and ready-to-use PHP scripts, please see the PHP Conditions Guide.