Buy Now
Sign in

Use fields content

webcrea , October 13 at 12:47
webcrea

how to use custom fields in chrono list ?

				Array
(
[restaurants] => Array
(
[log] => Array
(
[0] => SELECT COUNT(`restaurants`.`id`) AS `restaurants.count` FROM `art_content` AS `restaurants` WHERE `restaurants`.`catid` = '8';
[1] => SELECT `restaurants`.`id` AS `restaurants.id`, `restaurants`.`asset_id` AS `restaurants.asset_id`, `restaurants`.`title` AS `restaurants.title`, `restaurants`.`alias` AS `restaurants.alias`, `restaurants`.`introtext` AS `restaurants.introtext`, `restaurants`.`fulltext` AS `restaurants.fulltext`, `restaurants`.`state` AS `restaurants.state`, `restaurants`.`catid` AS `restaurants.catid`, `restaurants`.`created` AS `restaurants.created`, `restaurants`.`created_by` AS `restaurants.created_by`, `restaurants`.`created_by_alias` AS `restaurants.created_by_alias`, `restaurants`.`modified` AS `restaurants.modified`, `restaurants`.`modified_by` AS `restaurants.modified_by`, `restaurants`.`checked_out` AS `restaurants.checked_out`, `restaurants`.`checked_out_time` AS `restaurants.checked_out_time`, `restaurants`.`publish_up` AS `restaurants.publish_up`, `restaurants`.`publish_down` AS `restaurants.publish_down`, `restaurants`.`images` AS `restaurants.images`, `restaurants`.`urls` AS `restaurants.urls`, `restaurants`.`attribs` AS `restaurants.attribs`, `restaurants`.`version` AS `restaurants.version`, `restaurants`.`ordering` AS `restaurants.ordering`, `restaurants`.`metakey` AS `restaurants.metakey`, `restaurants`.`metadesc` AS `restaurants.metadesc`, `restaurants`.`access` AS `restaurants.access`, `restaurants`.`hits` AS `restaurants.hits`, `restaurants`.`metadata` AS `restaurants.metadata`, `restaurants`.`featured` AS `restaurants.featured`, `restaurants`.`language` AS `restaurants.language`, `restaurants`.`xreference` AS `restaurants.xreference` FROM `art_content` AS `restaurants` WHERE `restaurants`.`catid` = '8' LIMIT 25;
[2] => SELECT `valeurs`.`field_id` AS `valeurs.field_id`, `valeurs`.`item_id` AS `valeurs.item_id`, `valeurs`.`value` AS `valeurs.value`, `champs`.`id` AS `champs.id`, `champs`.`asset_id` AS `champs.asset_id`, `champs`.`context` AS `champs.context`, `champs`.`group_id` AS `champs.group_id`, `champs`.`title` AS `champs.title`, `champs`.`name` AS `champs.name`, `champs`.`label` AS `champs.label`, `champs`.`default_value` AS `champs.default_value`, `champs`.`type` AS `champs.type`, `champs`.`note` AS `champs.note`, `champs`.`description` AS `champs.description`, `champs`.`state` AS `champs.state`,
`champs`.`required` AS `champs.required`, `champs`.`checked_out` AS `champs.checked_out`, `champs`.`checked_out_time` AS `champs.checked_out_time`,
`champs`.`ordering` AS `champs.ordering`, `champs`.`params` AS `champs.params`, `champs`.`fieldparams` AS `champs.fieldparams`, `champs`.`language` AS
`champs.language`, `champs`.`created_time` AS `champs.created_time`, `champs`.`created_user_id` AS `champs.created_user_id`, `champs`.`modified_time` AS `champs.modified_time`, `champs`.`modified_by` AS `champs.modified_by`, `champs`.`access` AS `champs.access` FROM `art_fields_values` AS `valeurs` LEFT JOIN `art_fields` AS `champs` ON `valeurs`.`field_id` = `champs`.`id` WHERE `valeurs`.`item_id` IN ('17');
)

[var] => Array
(
[0] => Array
(
[restaurants] => Array
(
[id] => 17
[asset_id] => 88
[title] => A la bonne franquette
[alias] => a-la-bonne-franquette
[introtext] =>
[fulltext] =>
[state] => 1
[catid] => 8
[created] => 2017-10-13 11:54:31
[created_by] => 995
[created_by_alias] =>
[modified] => 2017-10-13 12:43:11
[modified_by] => 990
[checked_out] => 0
[checked_out_time] => 0000-00-00 00:00:00
[publish_up] => 2017-10-13 12:43:11
[publish_down] => 0000-00-00 00:00:00
[images] => {"image_intro":"","float_intro":"","image_intro_alt":"","image_intro_caption":"","image_fulltext":"","float_fulltext":"","image_fulltext_alt":"","image_fulltext_caption":""}
[urls] => {"urla":false,"urlatext":"","targeta":"","urlb":false,"urlbtext":"","targetb":"","urlc":false,"urlctext":"","targetc":""}
[attribs] => {"article_layout":"","show_title":"","link_titles":"","show_tags":"","show_intro":"","info_block_position":"","info_block_show_title":"","show_category":"","link_category":"","show_parent_category":"","link_parent_category":"","show_associations":"","show_author":"","link_author":"","show_create_date":"","show_modify_date":"","show_publish_date":"","show_item_navigation":"","show_icons":"","show_print_icon":"","show_email_icon":"","show_vote":"","show_hits":"","show_noauth":"","urls_position":"","alternative_readmore":"","article_page_title":"","show_publishing_options":"","show_article_options":"","show_urls_images_backend":"","show_urls_images_frontend":""}
[version] => 3
[ordering] => 0
[metakey] =>
[metadesc] =>
[access] => 1
[hits] => 0
[metadata] => {"robots":"","author":"","rights":"","xreference":""}
[featured] => 0
[language] => fr-FR
[xreference] =>
)

[valeurs] => Array
(
[0] => Array
(
[field_id] => 1
[item_id] => 17
[value] => 5
)

[1] => Array
(
[field_id] => 2
[item_id] => 17
[value] => 2
)

)

[champs] => Array
(
[0] => Array
(
[id] => 1
[asset_id] => 87
[context] => com_content.article
[group_id] => 0
[title] => Classement San Pellegrino
[name] => cls-sanpellegrino
[label] => Classement San Pellegrino
[default_value] =>
[type] => text
[note] =>
[description] =>
[state] => 1
[required] => 0
[checked_out] => 0
[checked_out_time] => 0000-00-00 00:00:00
[ordering] => 0
[params] => {"hint":"","render_class":"","class":"","showlabel":"1","show_on":"","display":"2"}
[fieldparams] => {"filter":"integer","maxlength":""}
[language] => *
[created_time] => 2017-10-13 11:54:08
[created_user_id] => 990
[modified_time] => 0000-00-00 00:00:00
[modified_by] => 0
[access] => 1
)

[1] => Array
(
[id] => 2
[asset_id] => 89
[context] => com_content.article
[group_id] => 0
[title] => Classement Michelin
[name] => cls-michelin
[label] => Classement Michelin
[default_value] =>
[type] => text
[note] =>
[description] =>
[state] => 1
[required] => 0
[checked_out] => 0
[checked_out_time] => 0000-00-00 00:00:00
[ordering] => 0
[params] => {"hint":"","render_class":"","class":"","showlabel":"1","show_on":"","display":"2"}
[fieldparams] => {"filter":"integer","maxlength":""}
[language] => *
[created_time] => 2017-10-13 12:42:55
[created_user_id] => 990
[modified_time] => 0000-00-00 00:00:00
[modified_by] => 0
[access] => 1
)

)

)

)

)

)

thanks

Christophe
http://www.webcrea.fr

admin

Hi Christophe,

What kind of custom fields ? please give an example

Best regrads

Max
If your main question got answered then please mark the answer using the button!

webcrea

Hi Max,

All the native custom fields create via Joomla.

Best regards

Christophe
http://www.webcrea.fr

admin

Hi Christophe,

Joomla does not save the extra fields in the same content table and so getting their values will require a multi value join, you are doing it correctly but a PHP loop on the values may be necessary to add the extra fields values to the main list, maybe this feature will be added to the core in the future but currently its not available.

Best regards

Max
If your main question got answered then please mark the answer using the button!

webcrea

ok
thanks

Christophe
http://www.webcrea.fr