Getting field elements of another none-core field

More
12 years 8 months ago - 12 years 7 months ago #18654 by fesghel
Hi there,
I'm using this:
www.flexicontent.org/forum/index ... =viewtopic
And based on that, I'm gonna develop a new specific weblink field. As I'm beginner in this field, I'm not so aware of everything or maybe anything.
The question is: How to get the field element(s) of the field I mentioned? Should I run a query and get it from db, or is there an easier way? I mean, isn't it saved somewhere around, like $item->fields ?

Thanks
Last edit: 12 years 7 months ago by fesghel.

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

More
12 years 7 months ago #18708 by fesghel
It seems no one saw this, or maybe ...
Any answers? Nothing?

Thanks

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

More
12 years 7 months ago #18718 by micker
I am not a dev but use file plugin to start your .. not ?

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

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

More
12 years 7 months ago #18723 by ggppdk
I think you meant to say that:
from inside a field of an item "A", you want to retrieve one or more fields of an item "B", right?


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

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

More
12 years 7 months ago #18732 by fesghel
I guess not.
I mean, I have added field "A" for a content type that get something from db and the field is not a core field. Now I want to develop a specific weblink field that uses the field's element of "A".
For example I have a content named "X". For "A" of this X I enterd "fesghel". Now I want to develop a new field that uses "fesghel". The question is how I can get "fesghel". Should I run the query again? Or can I get it in another way?

Thanks

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

More
12 years 7 months ago #18743 by ggppdk
It is possible
but it is needed that the display of field 'A' you need inside field 'B' must be calculated before 'B'

So you need:
1. to place ("Ordering") field "A" above field "B" in the field manager listing.

2. If you use v1.5.6 version put field "A" in the renderonly position, otherwise its HTML display will not be created

3. Inside code of field "B" (inside function onDisplayFieldValue) use:
$item->fields->display
to get the html display of field 'A'

I strongly suggest that you make the name of field(s) "A" parameter(s) of field "B" and get it like:

1. Inside the xml configuration file of field B use:
Code:
<param name="depfieldnameA1" type="text" default="" label="Dependent Field 1" description="Give Dependent Field to display inside this field" /> <param name="depfieldnameA2" type="text" default="" label="Dependent Field 2" description="Give Dependent Field to display inside this field" />

2. Inside function onDisplayFieldValue(), Get the name:
Code:
$depfieldnameA1 = $field->parameters->get( 'depfieldnameA1 ', '' ) ; $depfieldnameA2 = $field->parameters->get( 'depfieldnameA2 ', '' ) ;
3. and then use:
Code:
$item->fields[$depfieldnameA1]->display $item->fields[$depfieldnameA2]->display

Regards


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

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

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.309 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline