- Posts: 9
COMMUNITY FORUM
Placeholder inside extra field
- Lucas Gomes
- Topic Author
- Offline
- New Member
Less
More
5 years 11 months ago #170648
by Lucas Gomes
Placeholder inside extra field was created by Lucas Gomes
Hi,
I've been using K2 Version 2.9.0. I would like to insert a placeholder on Extra Field.
I thinks the file is in the path: components> com_k2>models> extrafield.php
Someone could help me?
I've been using K2 Version 2.9.0. I would like to insert a placeholder on Extra Field.
I thinks the file is in the path: components> com_k2>models> extrafield.php
Someone could help me?
Please Log in or Create an account to join the conversation.
- Mohamed Abdelaziz
- Offline
- Platinum Member
- Joomla Developer
5 years 11 months ago #170659
by Mohamed Abdelaziz
Multiple Extra Fields Groups for K2
AutoMeta for K2
Chained Fields for K2
More K2 Extensions In My Extensions Store
Replied by Mohamed Abdelaziz on topic Placeholder inside extra field
Hi Lucas
Can you give an example for what you want to achieve?
Can you give an example for what you want to achieve?
Multiple Extra Fields Groups for K2
AutoMeta for K2
Chained Fields for K2
More K2 Extensions In My Extensions Store
Please Log in or Create an account to join the conversation.
- Lucas Gomes
- Topic Author
- Offline
- New Member
Less
More
- Posts: 9
5 years 11 months ago #170666
by Lucas Gomes
Replied by Lucas Gomes on topic Placeholder inside extra field
Please Log in or Create an account to join the conversation.
- Mohamed Abdelaziz
- Offline
- Platinum Member
- Joomla Developer
5 years 11 months ago #170673
by Mohamed Abdelaziz
Multiple Extra Fields Groups for K2
AutoMeta for K2
Chained Fields for K2
More K2 Extensions In My Extensions Store
Replied by Mohamed Abdelaziz on topic Placeholder inside extra field
Hi Lucas,
The file path is administrator>components> com_k2>models> extrafield.php
For the text area field type, find this line:
Insert this line BEFORE it:
So the final code will be like this:
The file path is administrator>components> com_k2>models> extrafield.php
For the text area field type, find this line:
$output = '<textarea name="K2ExtraField_'.$extraField->id.'" id="K2ExtraField_'.$extraField->id.'" rows="'.$active[2].'" cols="'.$active[3].'" '.$attributes.'>'.htmlspecialchars($active[0], ENT_QUOTES, 'UTF-8').'</textarea>';
Insert this line BEFORE it:
$attributes .= ' placeholder="'. $extraField->name .'"';
So the final code will be like this:
$attributes .= ' placeholder="'. $extraField->name .'"';
$output = '<textarea name="K2ExtraField_'.$extraField->id.'" id="K2ExtraField_'.$extraField->id.'" rows="'.$active[2].'" cols="'.$active[3].'" '.$attributes.'>'.htmlspecialchars($active[0], ENT_QUOTES, 'UTF-8').'</textarea>';
Multiple Extra Fields Groups for K2
AutoMeta for K2
Chained Fields for K2
More K2 Extensions In My Extensions Store
Please Log in or Create an account to join the conversation.
- Lucas Gomes
- Topic Author
- Offline
- New Member
Less
More
- Posts: 9
5 years 11 months ago #170700
by Lucas Gomes
Replied by Lucas Gomes on topic Placeholder inside extra field
Omg, This worked here, Thanks, You helped me a lot. =D
Please Log in or Create an account to join the conversation.
- JoomlaWorks
- Offline
- Admin
Less
More
- Posts: 6218
5 years 10 months ago #170741
by JoomlaWorks
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by JoomlaWorks on topic Placeholder inside extra field
I've noted down to add this feature in K2 v2.11.
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.