Get field_type inside templates $field loop

More
2 years 7 months ago #80677 by tobajarrat
Hi @ all!

I try display a file field inside a dropdown button. The problem is the translation neither opening and closing tag nor 3rd party falang allows the label translation. (because of html).

So I had another idea by putting a special template position which wraps file fields inside dropdowns (with label as dropdown text). But I fail to get the field_type inside the $field loop (just to exclude other field types).

Or maybe somebody has another solution. Thank you in advance!

Im using latest joomla and latest Flexicontent

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

More
2 years 6 months ago #80737 by tobajarrat
Anybody can help me? You need more information?

Im using latest joomla and latest Flexicontent

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

More
2 years 6 months ago #80740 by ggppdk
Hello

you can post the code
i guess you are using
$item->positions as $field

but the above is not a full field it has only a few properties like
$field->label
$field->name
$field->display

It does not have
$field->field_type

you can try
$item->fields[$field->name]->field_type


-- 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
2 years 6 months ago - 2 years 6 months ago #80756 by iamrobert
Here's a post about extracting files:

www.flexicontent.org/forum/20-general-su...file-link.html#80726

I believe you can get the ext info from it.


​​​​​​​You can also get the language version in item.php.

So - if you want specific content to appear for English or other language that's possible as well.

Code:
    $lang = JFactory::getLanguage();     $tag = $lang->getTag();   if($tag == 'en-GB'){ echo "English"; }   if($tag == 'zh-TW'){ echo "Chinese"; }




Screenshots/Code would probably help.

 
Last edit: 2 years 6 months ago by iamrobert.

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

More
2 years 6 months ago #80777 by tobajarrat
Thank you for your contribution!

Im using latest joomla and latest Flexicontent

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

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.304 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