Thanks for fast answer Mohamed,
Just a small question,
I just see into the "administrator/components/com_k2/elements" many Elements
And I see how to make K2Element..
My php Element file is now:
(test file)
The "T" and "h"
it is the first and second letter of the "$output" variable.
I have tried to put an HTML div but ... same thing...
I guess it is for array?
My other problems is, if I need to get "Options" because it's a list...
I have try to var_dump all parameter like $name, $value $node...
and all parameter is null...
any Idea for this?
Thanks Alot,
Emond, Jean-Philippe
=====================================
EDIT:
I have modify my php file for this:
now... just know how to get "label" "description" and "option" if I have a custom ListElement.
Mohamed Abdelaziz
13 years 5 months ago #113706
Good result :)
For the label, you need to override the render function, just add this function to the element class:
function render(&$xmlElement, $value, $control_name = 'params') {
$name = $xmlElement->_attributes['name'];
$result[0] = $xmlElement->_attributes['label'];
$result[1] = $this->fetchElement($name, $value, $xmlElement, $control_name);
return $result;
}
Multiple Extra Fields Groups for K2
AutoMeta for K2
Chained Fields for K2
More K2 Extensions In My
Extensions Store
jean-philippe
Topic Author
13 years 5 months ago #113707
Cool Mohamed Abdelaziz,
Works now..
Attachment not found
Just a tiny fix now..
I can't save my value... ><"
Nota Bene: in the Xml.. if I change the custom type for "list".. the values is correctly saved.
!!
Emond, Jean-Philippe
jean-philippe
Topic Author
13 years 5 months ago #113708
Thanks Mohamed Abdelaziz for your Help,
I have found My error...
Base on the "list.php" K2Element, I Can now save my field.
So The Problem is Fixed now!
Thanks Again,
Emond, Jean-Philippe
Emond, Jean-Philippe
Mohamed Abdelaziz
13 years 5 months ago #113709
Great Jean :)
Enjoy your weekend.
Multiple Extra Fields Groups for K2
AutoMeta for K2
Chained Fields for K2
More K2 Extensions In My
Extensions Store