- Posts: 147
- Thank you received: 6
Bootstrap custom field inputbox change class
10 years 9 months ago #228051
by maujbigo
Bootstrap custom field inputbox change class was created by maujbigo
Hi,
I created an override for registration_bootstrap and one for custom_fields_boostrap
I was able to change the html container just fine however I can find how to change the class 'inputbox'
I need to use 'form-control' as the input field class.
Thanks, appreciate the help.
I created an override for registration_bootstrap and one for custom_fields_boostrap
I was able to change the html container just fine however I can find how to change the class 'inputbox'
I need to use 'form-control' as the input field class.
Thanks, appreciate the help.
Please Log in or Create an account to join the conversation.
10 years 9 months ago #228055
by Xavier
Replied by Xavier on topic Bootstrap custom field inputbox change class
Hi,
This class is set in a core file, the file "administrator/components/com_hikashop/classes/field.php", so editing this file is not a very good idea, every time you will update the changes will be lost.
So two solutions can be present, create an override of that class, or add some javascript in your template js file to replace the class of these specific html elements.
This class is set in a core file, the file "administrator/components/com_hikashop/classes/field.php", so editing this file is not a very good idea, every time you will update the changes will be lost.
So two solutions can be present, create an override of that class, or add some javascript in your template js file to replace the class of these specific html elements.
Please Log in or Create an account to join the conversation.
10 years 9 months ago #228100
by maujbigo
Replied by maujbigo on topic Bootstrap custom field inputbox change class
Hi xavier, thanks for getting back to me.
Would it be possible to use setFieldAttribute('fieldName', 'class', 'myclass')
In the custom_fields_boostrap override at all?
Just a small feedback note you guys may consider for future releases:
field and markup classes is something that in my opnion should always be an easy thing to change/add. A number of templates use different css frameworks, been able to use an specific framework class will help reduce the duplication in styles.
I appreciate e can change the container in the custom_fields_boostrap but changing the field classes would also be handy.
Would it be possible to use setFieldAttribute('fieldName', 'class', 'myclass')
In the custom_fields_boostrap override at all?
Just a small feedback note you guys may consider for future releases:
field and markup classes is something that in my opnion should always be an easy thing to change/add. A number of templates use different css frameworks, been able to use an specific framework class will help reduce the duplication in styles.
I appreciate e can change the container in the custom_fields_boostrap but changing the field classes would also be handy.
Please Log in or Create an account to join the conversation.
10 years 9 months ago #228196
by nicolas
Replied by nicolas on topic Bootstrap custom field inputbox change class
Hi,
You don't need to edit directly the core file as Xavier said.
You can actually do that change directly in the custom_fields_boostrap view file as an override.
Just change the code :
to:
You don't need to edit directly the core file as Xavier said.
You can actually do that change directly in the custom_fields_boostrap view file as an override.
Just change the code :
Code:
echo $this->fieldsClass->display(
$oneExtraField,
@$this->$type->$fieldName,
'data['.$type.']['.$fieldName.']',
false,
' '.$onWhat.'="hikashopToggleFields(this.value,\''.$fieldName.'\',\''.$type.'\',0);"',
false,
$this->extraFields[$type],
$this->$type
);
Code:
echo str_replace('inputbox','form-control', $this->fieldsClass->display(
$oneExtraField,
@$this->$type->$fieldName,
'data['.$type.']['.$fieldName.']',
false,
' '.$onWhat.'="hikashopToggleFields(this.value,\''.$fieldName.'\',\''.$type.'\',0);"',
false,
$this->extraFields[$type],
$this->$type)
);
The following user(s) said Thank You: maujbigo
Please Log in or Create an account to join the conversation.
10 years 9 months ago #228345
by maujbigo
Replied by maujbigo on topic Bootstrap custom field inputbox change class
Cool, thanks for that.
Please Log in or Create an account to join the conversation.
Less
More
- Posts: 4
- Thank you received: 0
7 years 1 week ago - 7 years 1 week ago #312831
by Ilya Kislov
Replied by Ilya Kislov on topic Bootstrap custom field inputbox change class
Hello, its grade, Thank you .
But same problem , please help.
i have the code
in view file - order/listing.php
How to change class="inputbox" to class="someclass"
But same problem , please help.
i have the code
Code:
///////
foreach($this->leftFilters as $name => $filterObj) {
if(is_string($filterObj))
echo $filterObj;
else
echo $filterObj->displayFilter($name, $this->pageInfo->filter);
}
/////////
How to change class="inputbox" to class="someclass"
Last edit: 7 years 1 week ago by nicolas.
Please Log in or Create an account to join the conversation.
7 years 1 week ago #312847
by nicolas
Replied by nicolas on topic Bootstrap custom field inputbox change class
Hi,
You can change the line:
to:
It's basically the same solution as explained before.
You can change the line:
Code:
echo $filterObj->displayFilter($name, $this->pageInfo->filter);
Code:
echo str_replace('class="inputbox"', 'class="someclass"', $filterObj->displayFilter($name, $this->pageInfo->filter));
Please Log in or Create an account to join the conversation.
Less
More
- Posts: 4
- Thank you received: 0
7 years 1 week ago #312883
by Ilya Kislov
Replied by Ilya Kislov on topic Bootstrap custom field inputbox change class
Sorry , on this place the code, it not work, you could try it yourself
I solved this problem that
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
$( ".inputbox" ).removeClass( "inputbox" ).addClass( "form-control" );
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
in my template.js , on ( document ).ready
I solved this problem that
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
$( ".inputbox" ).removeClass( "inputbox" ).addClass( "form-control" );
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
in my template.js , on ( document ).ready
Please Log in or Create an account to join the conversation.
7 years 1 week ago #312899
by nicolas
Replied by nicolas on topic Bootstrap custom field inputbox change class
Hi,
That's a possibility too. In fact the great thing with your proposal is that it will work for all the views where there are dropdowns with the inputbox class without having to edit each place. So it's even better.
That's a possibility too. In fact the great thing with your proposal is that it will work for all the views where there are dropdowns with the inputbox class without having to edit each place. So it's even better.
Please Log in or Create an account to join the conversation.
Time to create page: 0.092 seconds