Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions administrator/components/com_fields/models/forms/field.xml
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,28 @@
showon="showlabel:1"
/>

<field
name="showsuffix"
type="radio"
label="COM_FIELDS_FIELD_SHOWSUFFIX_LABEL"
description="COM_FIELDS_FIELD_SHOWSUFFIX_DESC"
class="btn-group btn-group-yesno"
default="0"
>
<option value="1">JSHOW</option>
<option value="0">JHIDE</option>
</field>

<field
name="suffix"
type="text"
label="COM_FIELDS_FIELD_SUFFIX_LABEL"
description="COM_FIELDS_FIELD_SUFFIX_DESC"
class="input-xxlarge"
size="40"
showon="showsuffix:1"
/>

<field
name="display"
type="list"
Expand Down
4 changes: 4 additions & 0 deletions administrator/language/en-GB/en-GB.com_fields.ini
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,15 @@ COM_FIELDS_FIELD_RENDER_CLASS_DESC="The class attributes of the field when the f
COM_FIELDS_FIELD_RENDER_CLASS_LABEL="Render Class"
COM_FIELDS_FIELD_REQUIRED_DESC="Is this a mandatory field?"
COM_FIELDS_FIELD_REQUIRED_LABEL="Required"
COM_FIELDS_FIELD_SHOWSUFFIX_DESC="Show or hide the suffix when the field renders."
COM_FIELDS_FIELD_SHOWSUFFIX_LABEL="Show Suffix"
COM_FIELDS_FIELD_SHOW_ON_ADMIN="Administrator"
COM_FIELDS_FIELD_SHOW_ON_BOTH="Both"
COM_FIELDS_FIELD_SHOW_ON_DESC="On which part of the site should the field be shown?"
COM_FIELDS_FIELD_SHOW_ON_LABEL="Show On"
COM_FIELDS_FIELD_SHOW_ON_SITE="Site"
COM_FIELDS_FIELD_SUFFIX_DESC="Suffix to be displayed after the field value."
COM_FIELDS_FIELD_SUFFIX_LABEL="Suffix"
COM_FIELDS_FIELD_TYPE_DESC="The type of the field."
COM_FIELDS_FIELD_TYPE_LABEL="Type"
COM_FIELDS_FIELD_USE_GLOBAL="Use settings from Plugin"
Expand Down
6 changes: 6 additions & 0 deletions components/com_fields/layouts/field/render.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
$value = $field->value;
$showLabel = $field->params->get('showlabel');
$labelClass = $field->params->get('label_render_class');
$showSuffix = $field->params->get('showsuffix');
$suffix = JText::plural($field->params->get('suffix'), $value);


if ($value == '')
{
Expand All @@ -29,3 +32,6 @@
<span class="field-label <?php echo $labelClass; ?>"><?php echo htmlentities($label, ENT_QUOTES | ENT_IGNORE, 'UTF-8'); ?>: </span>
<?php endif; ?>
<span class="field-value"><?php echo $value; ?></span>
<?php if ($showSuffix == 1) : ?>
<span class="field-suffix"><?php echo htmlentities($suffix, ENT_QUOTES | ENT_IGNORE, 'UTF-8'); ?></span>
<?php endif; ?>