Автор:
Дмитрий Кондин
Возьмем для примера шаблон вывода VIP-объявлений (спец.предложений).
/template/frontend/ваш_шаблон/right_special.tpl
Ключевой цикл перебора вариантов находится тут
{section name=i loop=$special_items2}...{/section}
В процессе обхода этого цикла будет доступен следующий массив для каждой итерации
{$special_items2[i]}
Если нам нужно вытащить какие нибудь поля из него и вывести, например, площадь то мы можем сделать это так:
{$special_items2[i].square_all}
А вот можно увидеть весь массив и что в нем лежит, если в цикле вызовем это
<pre> {$special_items2[i]|@print_r}</pre>
Мы увидим такое:
Array( [currency_code] => RUR [currency_name] => р. [price_ue] => 0 [id] => 400896 [user_id] => 1 [type_id] => 0 [topic_id] => 6143 [country_id] => 0 [city_id] => 1 [metro_id] => 32 [district_id] => 0 [street] => ВАЛОВАЯ [price] => 0 [text] => Русское описание [contact] => [date_added] => 2014-01-29 13:13:54 [agent_tel] => [room_count] => 2 [elite] => 0 [session_id] => [active] => 1 [sub_id1] => 0 [sub_id2] => 0 [reviews_count] => 0 [hot] => 1 [floor] => 10 [floor_count] => 15 [walls] => Монолит [balcony] => [square_all] => 74 [square_live] => [square_kitchen] => [bathroom] => [img1] => [img2] => [img3] => [img4] => [img5] => [img1_preview] => [img2_preview] => [img3_preview] => [img4_preview] => [img5_preview] => [is_telephone] => 1 [furniture] => 1 [plate] => нет [agent_email] => [number] => [spec] => 0 [floor_cover] => [square_room] => [is_kitchen] => 0 [region_id] => 0 [street_id] => 139 [planning] => [dom] => [flat_number] => [owner] => [source] => [adv_date] => [more1] => [more2] => [more3] => [youtube] => [fio] => [phone] => [realty_type_id] => 0 [view_count] => 38 [best] => 0 [email] => [distance] => [tmp_password] => [ad_mobile_phone] => [ad_stacionary_phone] => [can_call_start] => [can_call_end] => [currency_id] => 1 [meta_title] => аренда квартир Москва Достоевская Парковая улица (пос. Новобратцевский) [meta_description] => аренда квартир Москва Достоевская Парковая улица (пос. Новобратцевский) [meta_keywords] => аренда квартир Москва Достоевская Парковая улица (пос. Новобратцевский) [geo_lat] => 55.722469 [geo_lng] => 37.472991 [vip_status_end] => 0 [premium_status_end] => 0 [bold_status_end] => 0 [text_en] => English description [optype] => [sdfsdfs] => [complex_id] => 1 [image] => Array ( [0] => Array ( [preview] => prv533a69d43da5b_1396337108_1.jpg [normal] => img533a69d43da55_1396337108_1.jpg [type] => graphic [mime] => jpg ) [1] => Array ( [preview] => prv533a69d467dea_1396337108_2.jpg [normal] => img533a69d467de2_1396337108_2.jpg [type] => graphic [mime] => jpg ) [2] => Array ( [preview] => prv533a69d489eda_1396337108_3.jpg [normal] => img533a69d489ed3_1396337108_3.jpg [type] => graphic [mime] => jpg ) [3] => Array ( [preview] => prv533a69d4bb78e_1396337108_4.jpg [normal] => img533a69d4bb787_1396337108_4.jpg [type] => graphic [mime] => jpg ) [4] => Array ( [preview] => prv533a69d4df23d_1396337108_5.jpg [normal] => img533a69d4df233_1396337108_5.jpg [type] => graphic [mime] => jpg ) ) [expire_date] => 0000-00-00 00:00:00 [payed_adv] => 0 [manually_added] => 0 [direction] => [time_on_transport] => [time_on_foot] => [railway_station] => [not_for_agents] => 0 [haggle] => 0 [mortgage] => 0 [prepayment] => [rent_pledge] => 0 [agent_fee] => [with_pets] => 0 [with_children] => 0 [renovation] => [lot_type] => [lot_area] => [new_flat] => 0 [rooms] => 0 [rooms_offered] => 0 [open_plan] => 0 [rooms_type] => [internet] => 0 [room_furniture] => 0 [kitchen_furniture] => 0 [television] => 0 [washing_machine] => 0 [refrigerator] => 0 [bathroom_unit] => [floor_covering] => [window_view] => [building_name] => [building_type] => [building_series] => [building_state] => не выбрано [built_year] => [ready_quarter] => [lift] => 0 [rubbish_chute] => 0 [is_elite] => 0 [parking] => 0 [alarm] => 0 [ceiling_height] => [pmg] => 0 [kitchen] => 0 [pool] => 0 [billiard] => 0 [sauna] => 0 [heating_supply] => 0 [water_supply] => 0 [sewerage_supply] => 0 [electricity_supply] => 0 [gas_supply] => 0 [toilet] => не выбрано [shower] => не выбрано [cpos_id] => 0 [cuch_id] => 0 [type_sh] => arenda kvartir [company] => [city] => Москва [metro] => Достоевская [user] => Кондин Дмитрий Валерьевич [currency] => RUR [path] => arenda kvartir [date] => 29.01 [datetime] => 29.01 13:13 [topic_info] => Array ( [id] => 6143 [name] => arenda kvartir [name_en] => [active] => 0 [parent_id] => 0 [order] => 3 [sql_where] => [obj_type_id] => 0 [def_id1] => 0 [def_id2] => 0 [operation_type_id] => 0 [url] => arenda-kvartir [description] => [meta_title] => [meta_keywords] => [meta_description] => [name_am] => [name_cn] => [name_ua] => ) [parent_category_url] => arenda-kvartir/ [href] => /arenda-kvartir/realty400896 [img] => Array ( [0] => Array ( [preview] => prv533a69d43da5b_1396337108_1.jpg [normal] => img533a69d43da55_1396337108_1.jpg [type] => graphic [mime] => jpg ) [1] => Array ( [preview] => prv533a69d467dea_1396337108_2.jpg [normal] => img533a69d467de2_1396337108_2.jpg [type] => graphic [mime] => jpg ) [2] => Array ( [preview] => prv533a69d489eda_1396337108_3.jpg [normal] => img533a69d489ed3_1396337108_3.jpg [type] => graphic [mime] => jpg ) [3] => Array ( [preview] => prv533a69d4bb78e_1396337108_4.jpg [normal] => img533a69d4bb787_1396337108_4.jpg [type] => graphic [mime] => jpg ) [4] => Array ( [preview] => prv533a69d4df23d_1396337108_5.jpg [normal] => img533a69d4df233_1396337108_5.jpg [type] => graphic [mime] => jpg ) ))
Если проанализировать этот массив, то можно понять, что улица у нас доступна так
{$special_items2[i].street}
Если нам нужны данные, которые лежат внутри вложенного массива, например, название категории, то делаем так
{$special_items2[i].topic_info.name}