Keyword

How to create a new custom Extrafield-Type?

  • Electronic Beatz Network
  • Electronic Beatz Network's Avatar Topic Author
  • Offline
  • New Member
More
2 years 11 months ago #178600 by Electronic Beatz Network
How to create a new custom Extrafield-Type? was created by Electronic Beatz Network
Hi.

I try to find out how to create a new extrafield-type. In my example i need an extrafield which do an sql-query and give me the result as a dropdown, similar to the JoomlaCore-Fields: docs.joomla.org/J3.x:Adding_custom_fields/Sql_Field

Does anybody know which files I have to change (or create new)?

Thanx

Please Log in or Create an account to join the conversation.

  • Electronic Beatz Network
  • Electronic Beatz Network's Avatar Topic Author
  • Offline
  • New Member
More
2 years 11 months ago #178601 by Electronic Beatz Network
Replied by Electronic Beatz Network on topic How to create a new custom Extrafield-Type?
Or - where can I change the output of "$extraField->element"?

I just need the pure value without the generated input-field/HTML-Tag.

Please Log in or Create an account to join the conversation.

More
2 years 11 months ago #178635 by JoomlaWorks
Replied by JoomlaWorks on topic How to create a new custom Extrafield-Type?
You can't create custom extra fields. Only K2 plugins. Find the K2 Example plugin on github.com/getk2/ and star with that. Since it's a plugin, you can create anything you like, even custom fields for the item (and other) forms.

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Electronic Beatz Network
  • Electronic Beatz Network's Avatar Topic Author
  • Offline
  • New Member
More
2 years 11 months ago #178681 by Electronic Beatz Network
Replied by Electronic Beatz Network on topic How to create a new custom Extrafield-Type?
Thanx for the answere.

I solved it with a dirty workaround like this to output just the value (from field id 55) without the generated input-field/HTML-Tag.

$LabelName = explode("<input type=\"text\" name=\"K2ExtraField_55\" id=\"K2ExtraField_55\" value=\"", $custom_field->LabelName->element);
$LabelName = explode("\"", $LabelName[1]);
$LabelName = $LabelName[0];

With this I could create a db-output for a custom dropdown (with the previous valueselected)

<option value="<?=$singleOrganisation[1]?>"<? if ($singleOrganisation[1] == $LabelName) { echo " selected=\"selected\""; } ?>><?=$singleOrganisation[1]?></option><? } ?>

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum