Custom fields in a child category

For Joomla! 5.x Coding related discussions, you could also use: http://groups.google.com/group/joomla-dev-general

Moderators: ooffick, General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Post Reply
MsenaMsena
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Fri Jan 28, 2022 5:50 am

Custom fields in a child category

Post by MsenaMsena » Fri Apr 12, 2024 2:47 pm

To display custom fields in the parent category I use the code:

Code: Select all

<?php
foreach ($this->category->jcfields as $jcfield) {
    $this->category->jcFields[$jcfield->name] = $jcfield;
}
	
$myCustomFields = array();
	foreach($this->category->jcfields as $field) {
$myCustomFields[$field->name] = $field->value;
    } 
?>				
<?php echo $myCustomFields['iconsvg']; ?>
and it works

How can I display custom fields in a child category?
Last edited by toivo on Fri Apr 12, 2024 11:17 pm, edited 1 time in total.
Reason: mod note: moved from 5.x General Questions

Post Reply

Return to “Joomla! 5.x Coding”