Timeline for How to conditionally display custom fields in template overrides
Current License: CC BY-SA 4.0
10 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Nov 24, 2023 at 5:56 | answer | added | Sagar Shah | timeline score: 0 | |
Nov 22, 2023 at 23:12 | answer | added | Irata♦ | timeline score: 1 | |
Nov 22, 2023 at 18:22 | comment | added | Mike Hermary | @Irata After additional investigation, it looks like the custom field's value has whitespace stored when saving the article in Joomla. This applies to the media and video custom fields. The rawvalue is stored correctly. | |
Nov 22, 2023 at 18:09 | history | edited | Mike Hermary | CC BY-SA 4.0 |
Added var_dump of $media custom field
|
Nov 22, 2023 at 18:01 | comment | added | Mike Hermary |
@Irata $video and $media are both custom fields, and are encountering the same issue. I have included the var_dump for the $media custom field for reference.
|
|
Nov 22, 2023 at 9:16 | comment | added | Irata♦ | The condition block is checking $media, not $video, so you need to print_r($media) rather than $video. | |
Nov 22, 2023 at 2:07 | comment | added | Mike Hermary |
@Irata I have added a print_r of the $video variable to my original question. There does not seem to be any values assigned to the one selected from the blog listing. This means it should not display if empty.
|
|
Nov 22, 2023 at 2:05 | history | edited | Mike Hermary | CC BY-SA 4.0 |
Added dump output of problematic variable
|
Nov 21, 2023 at 21:30 | comment | added | Irata♦ |
If you add a <?php var_dump($media); ?> statement inside your if block to see what the real properties are of $media at the time the condition is checked. It may not be as empty as you think.
|
|
Nov 21, 2023 at 20:40 | history | asked | Mike Hermary | CC BY-SA 4.0 |