Getting field elements of another none-core field

More
14 years 4 months ago #18815 by ggppdk

where you assign the value of field "A" to a parameter of field "B"?


I meant to make a new configuration parameter (of type text) for field B where you could write the name of A inside this parameter. This so that you don't hard-code it into your code. I mean it is cleaner, and nicer with a parameter.

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 review. Thanks!

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

More
14 years 4 months ago #18826 by fesghel
I did what you said, in a better word, what I got from your instruction, but it didn't work.
I doesn't show anything as it has no value.

Thanks

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

More
14 years 4 months ago #18840 by ggppdk
Maybe the field A was not calculated before B.

Please do this:
1. Filter the fields by type and select the type of your item.
2. Then order the fields and place A before B

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 review. Thanks!

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

More
14 years 4 months ago #18842 by fesghel
The ordering was alright already, but it's not working. You sure it must be the name and not the id?

Thanks

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

More
14 years 4 months ago #18843 by ggppdk
You must order by type

Did you do that?


-- 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 review. Thanks!

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

More
14 years 4 months ago #18846 by fesghel
Yes, I did.

Thanks

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

More
14 years 4 months ago #18847 by ggppdk
mmm, ok, then i will test the solution i proposed ...


-- 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 review. Thanks!

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

More
14 years 4 months ago #18853 by fesghel
And another q. I used this code to run the query:

$db =& JFactory::getDBO();
$field_elements= 'SELECT DISTINCT i.id as value, i.title as text, i.catid as catid,'
.' FROM #__content as i'
.' LEFT JOIN #__flexicontent_fields_item_relations AS fi_rel ON i.id=fi_rel.value'
.' LEFT JOIN #__flexicontent_cats_item_relations AS rel ON rel.itemid = i.id AND rel.catid=i.catid'
.' LEFT JOIN #__categories AS c ON c.id = rel.catid'
.' WHERE fi_rel.field_id='.$field_id
.' AND fi_rel.item_id='.$item->id
;
$query = preg_match('#^select#i', $field_elements) ? $field_elements : '';
$db->setQuery($query);

$results =$db>loadObjectList();

but in the end $results is empty, while it's working on the original plugin(The one I linked in the first post of the topic). What is the problem?

Thanks

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

More
14 years 4 months ago #18875 by ggppdk
I see that the query includes some PHP variables. (e.g.: $field_id)
First make sure that you have copied the ALL the code that assigns a value to these variables.

Also print these variables, to make sure they have (a correct) value. You can also print and copy the query, and then use phpmyadmin to test what rows it returns.

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 review. Thanks!

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

More
14 years 4 months ago #19160 by fesghel
I really did check all of them. I even got the output query and test it and it was right, but it's still not workin'. At the end of this code, I added this:

if (!$results) {
$depfieldnameA1 = '123';

} else {

$depfieldnameA1 .= $results->text;
}

And it doesn't return anything. I mean it has a result(and doesn't get me '123') but I'm getting no answer.

Anyway, do I really have to run the query again?

Thanks

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

Moderators: vistamediajoomlacornerggppdk
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
Save