Display field in blog item template

More
11 years 6 months ago #42619 by dmayak
This should be simple but I haven't found answer on forum - how to display additional fields in blog template(components/com_flexicontent/templates/blog/item.php)?
$this->item->fields and $this->fields both do not have a display property and I don't see any other field-related properties in $this...

here is my additional field, type - file
Code:
object(stdClass)#565 (22) { ["id"]=> string(2) "24" ["asset_id"]=> string(3) "148" ["field_type"]=> string(4) "file" ["name"]=> string(12) "pressrelfile" ["label"]=> string(32) "Файл пресс-релиза" ["description"]=> string(0) "" ["isfilter"]=> string(1) "0" ["isadvfilter"]=> string(1) "0" ["iscore"]=> string(1) "0" ["issearch"]=> string(1) "1" ["isadvsearch"]=> string(1) "0" ["untranslatable"]=> string(1) "0" ["formhidden"]=> string(1) "0" ["valueseditable"]=> string(1) "0" ["edithelp"]=> string(1) "2" ["positions"]=> string(0) "" ["published"]=> string(1) "1" ["attribs"]=> string(791) "{"display_label":"1","size":"30","required":"1","autoselect":"1","remove_space":"0","pretext":"","posttext":"","separatorf":"1","opentag":"","closetag":"","useicon":"1","display_filename":"2","display_descr":"0","usebutton":"2","buttontext":"\u0421\u043a\u0430\u0447\u0430\u0442\u044c","allowshare":"0","sharetext":"FLEXI_EMAIL_SHARE_LINK","noaccess_display":"1","noaccess_addvars":"0","noaccess_url_unlogged":"","noaccess_msg_unlogged":"","noaccess_url_logged":"","noaccess_msg_logged":"","display_filter_as_s":"1","use_downloads_manager":"0","send_notifications":"0","notification_tmpl":"%%FLEXI_FDN_FILE_NO%% __FILE_ID__: [__FILE_TITLE__] \r\n %%FLEXI_FDN_FILE_IN_ITEM%% __ITEM_TITLE__: \r\n __ITEM_URL__","send_all_to_email":"","send_to_current_item_owner":"0","send_to_email_field":""}" ["checked_out"]=> string(3) "329" ["checked_out_time"]=> string(19) "2013-11-26 13:58:51" ["access"]=> string(1) "1" ["ordering"]=> string(2) "23" }

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

More
11 years 6 months ago #42622 by ggppdk
Hello

use template layout editor to drag and drop fields into positions

- go to template backend tab and click to edit the desired layout of blog template,
blog template has both category layout and item layout

if you want to place it manually inside your template
by doing
Code:
echo $item->fields['fieldname']->display;

TO BE ABLE TO USE THE ABOVE:

1. EITHER add field to template position 'render_only' or call function getFieldDisplay to create the HTML display of the field:

www.flexicontent.org/component/f ... ?Itemid=28
Code:
FlexicontentFields::getFieldDisplay($item, 'fieldname');

2. OR create it manually inside the template:
Code:
FlexicontentFields::getFieldDisplay($item, 'fieldname', null, 'display');

-- To get other custom variable inside your template e.g 'display_small' use:
Code:
FlexicontentFields::getFieldDisplay($item, 'fieldname', null, 'display_small');


-- 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
11 years 6 months ago #42638 by dmayak
Thank you very much for the detailed reply, this field will be wrapped in several additional elements, so I have to put it manually.
Code:
FlexicontentFields::getFieldDisplay($item, 'fieldname');
works well, although for blog template $item needs to be declared earlier as
Code:
$item=$this->item
or use
Code:
FlexicontentFields::getFieldDisplay($this->item, 'fieldname');

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

More
11 years 6 months ago #42655 by ggppdk
Hello

you may find these interesting:

code.google.com/p/flexicontent/i ... ail?id=614

code.google.com/p/flexicontent/i ... ail?id=615

no date for these, just high in priority

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.959 seconds
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