0

0

i have created some custom fields in Joomla and created an over-ride:

/components/com_fields/layouts/field/render.php to /templates/YOUR_TEMPLATE/html/layouts/com_fields/field/MY_OVERRIDE.ph

Currently the fields show as such:

Field 1 
Field 2 
Field 3

I would like to display them as:

Field 1 Field 2 Field 3

I am OK styling them with css but my php skills are lacking.

This seems to be part of code that outputs it and i have tried putting tables in but no luck. Also don't understand why there is not an echo for each field.

Thanks for any help!

<?php if ($showLabel == 1) : ?>
    <span class="field-label <?php echo $labelClass; ?>"><?php echo htmlentities($label, ENT_QUOTES | ENT_IGNORE, 'UTF-8'); ?>: </span>
<?php endif; ?>
<?php if ($prefix) : ?>
    <span class="field-prefix"><?php echo htmlentities($prefix, ENT_QUOTES | ENT_IGNORE, 'UTF-8'); ?></span>
<?php endif; ?>
<span class="field-value <?php echo $valueClass; ?>"><?php echo $value; ?></span>
<?php if ($suffix) : ?>
    <span class="field-suffix"><?php echo htmlentities($suffix, ENT_QUOTES | ENT_IGNORE, 'UTF-8'); ?></span>
<?php endif; ?>

1 Answer 1

1

Custom fields are rendered inside an ul.fields-container as li.filed-entry. So, why don't convert the ul into a flexy div and use flex-flow to define the layout of the fileds?

Btw there are 2 files into com_fields/layout

  • field/render.php, the one you overriddend, that controls the single custom field
  • fields/render.php that controls the list.

Overriding the fileds/render.php you can change how the container of the single custom items is displayed.

2
  • Thank you Davide. That has clarified a few things. Where do I find the ul.fields-container and li.filed-entry code?
    – user408
    Oct 29, 2023 at 10:12
  • The list is located in the components/com_fields/layouts/fields/render.php The item is in the field/render.php (same path) To override them use the override feature of your template... so in Admin, select System, then template -> site template, then Create Ovverride -> layout -> com_fields Nov 1, 2023 at 16:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.