Questions tagged [conditional-statements]

In computer science, conditional statements, conditional expressions and conditional constructs are features of a programming language which perform different computations or actions depending on whether a programmer-specified boolean condition evaluates to true or false.

Filter by
Sorted by
Tagged with
0
votes
3answers
59 views

(Module override/PHP) Checking if a content-item has an image otherwise display a placeholder

I am customising a Joomla module (Override) and it does not seem to accommodate if an image is not selected (just shows a broken image symbol). What I'd like to do is check if there is an image and ...
3
votes
1answer
238 views

How to use the showon attribute with multiple conditions?

In a Joomla 3.9.3 module, I'm trying, with no luck, to show/hide a field with showon by checking the values on other three fields My XML: <field name="foo" type="text" /> <field ...
-1
votes
1answer
377 views

How to write a conditional check on a column value with a mysql query?

I am trying to setup a simple default statement on the results page of a testing system. This seems like it would be relatively simple, but I cannot get my if statement to process properly. The ...
0
votes
2answers
775 views

Why does strpos function in first condition always return true?

Something is wrong with my code. No matter what the $_SERVER['REQUEST_URI'] value is, gkPageContent is always displayed. if (strpos($_SERVER['REQUEST_URI'], "online") >= 0) { $left_col_class =...
3
votes
1answer
2k views

How to conditionally show fields in module xml?

I created a simple module to enter values in textfields which I show in module positions on the frontend (banner images...). Now I need a solution like if dropdown value in fieldname "xy" is "xyz" ...
0
votes
2answers
160 views

How to write a condition to check if a number is a multiple of 30?

How to set up an array so that instead of maximum - an array on multiples of 30 is shown i.e $max = 30, 60, 90, 120, 150......and so on If array $max matches on multiple of 30, 60, 90, 120, 150, 180,...