Moving * for required fields
13 years 6 months ago #96676
by jansuhr
Jan Suhr
www.colorconsult.se www.jansuhr.se
Moving * for required fields was created by jansuhr
I want to have the * next to the field name instead of its now akward position under the field.
I could edit this in the display/view/registration file to get what I want.
But for the other fields that are custom fields I can't find where to edit this.
See attachement.
Thanks
Jan
I could edit this in the display/view/registration file to get what I want.
But for the other fields that are custom fields I can't find where to edit this.
See attachement.
Thanks
Jan
Jan Suhr
www.colorconsult.se www.jansuhr.se
Please Log in or Create an account to join the conversation.
Less
More
- Posts: 12953
- Thank you received: 1778
13 years 6 months ago #96716
by Mohamed Thelji
Replied by Mohamed Thelji on topic Moving * for required fields
Hi Jan,
If you really want to do that, I think that you'll have to :
- Edit the file "Hikashop/back/classes/field.php"
- Change the line :
by :
Hope this will help you a little.
If you really want to do that, I think that you'll have to :
- Edit the file "Hikashop/back/classes/field.php"
- Change the line :
Code:
function display(&$field, $value, $map, $inside = false, $options = '', $test = false, $allFields = null, $allValues = null){
$field_type = $field->field_type;
if(substr($field->field_type,0,4) == 'plg.') {
$field_type = substr($field->field_type,4);
JPluginHelper::importPlugin('hikashop', $field_type);
}
$classType = 'hikashop'.ucfirst($field_type);
$class = new $classType($this);
if(is_string($value))
$value = htmlspecialchars($value, ENT_COMPAT,'UTF-8');
$html = $class->display($field,$value,$map,$inside,$options,$test,$allFields,$allValues);
if(!empty($field->field_required)){
$html .=' <span class="hikashop_field_required">*</span>';
}
return $html;
}
Code:
function display(&$field, $value, $map, $inside = false, $options = '', $test = false, $allFields = null, $allValues = null){
$field_type = $field->field_type;
if(substr($field->field_type,0,4) == 'plg.') {
$field_type = substr($field->field_type,4);
JPluginHelper::importPlugin('hikashop', $field_type);
}
$classType = 'hikashop'.ucfirst($field_type);
$class = new $classType($this);
if(is_string($value))
$value = htmlspecialchars($value, ENT_COMPAT,'UTF-8');
$html= '';
if(!empty($field->field_required)){
$html .=' <span class="hikashop_field_required">*</span>';
}
$html .= $class->display($field,$value,$map,$inside,$options,$test,$allFields,$allValues);
return $html;
}
Hope this will help you a little.
The following user(s) said Thank You: jansuhr
Please Log in or Create an account to join the conversation.
13 years 6 months ago #96742
by jansuhr
Jan Suhr
www.colorconsult.se www.jansuhr.se
Replied by jansuhr on topic Moving * for required fields
Hi Mohamed,
That moved them but only on top of the field instead of at the bottom.
I want them to be after the label in the tablecell before the cell that has the input field.
I might go with the other approach and setting the class hikashop_filed_required to be hidden and the rename the field names to include the * symbol.
Jan
That moved them but only on top of the field instead of at the bottom.
I want them to be after the label in the tablecell before the cell that has the input field.
I might go with the other approach and setting the class hikashop_filed_required to be hidden and the rename the field names to include the * symbol.
Jan
Jan Suhr
www.colorconsult.se www.jansuhr.se
Please Log in or Create an account to join the conversation.
13 years 6 months ago #96744
by nicolas
Replied by nicolas on topic Moving * for required fields
You should hide the * with CSS and then add the * after the label display in the custom_fields or custom_fields_bootstrap file of the view user via the menu Display->Views.
For example, to add it to all the fields, you can simply add a * after:
<?php echo $this->fieldsClass->getFieldName($oneExtraField);?>
For example, to add it to all the fields, you can simply add a * after:
<?php echo $this->fieldsClass->getFieldName($oneExtraField);?>
The following user(s) said Thank You: jansuhr
Please Log in or Create an account to join the conversation.
13 years 6 months ago #96745
by jansuhr
Jan Suhr
www.colorconsult.se www.jansuhr.se
Replied by jansuhr on topic Moving * for required fields
Hi Nicoals,
Yes I went with that method, except that I had to change it in my Swedish language file too.
And I don't need it on all fields so your tip can't be used this time.
Thanks
Jan
Yes I went with that method, except that I had to change it in my Swedish language file too.
And I don't need it on all fields so your tip can't be used this time.
Thanks
Jan
Jan Suhr
www.colorconsult.se www.jansuhr.se
Please Log in or Create an account to join the conversation.
Time to create page: 0.189 seconds