string(3) "379"
Media
10.24.2016 18:52:08
Articles
379
The module connects any infoblock with elements of medialiblary
The module creates the intermediate infoblock "Medialiblary" where it skids collections and photos from the medialibrary. Collections become sections of an infoblock, photos become elements.

 Since at present there are no events of processing at present to add/edit/delete elemen of medialiblary, synchronization of elements with an infoblock occurs manually, by pressing the separately carried out button.

Description of installation and setup of the module
  1. Press the button "Install". 

    1.jpg

  2. After successful installation the new infoblock will appear among infoblocks.
    If this type is absent - it will be created. 

    2.jpg

  3.  In the administrative menu in the section "services" the option "synchronization with media library" will appear. On clicking of the synchronize button elements and collections from media library are copied in an infoblock, in hierarchic order. At the same time the id of an element and a collection from medialibrary are stored in additional member properties and the section. That is - in case of repeated synchronization those elements which already are in an infoblock won't be re-recorded.

    3.jpg

    4.jpg

    5.jpg
     
    For creation of a slider by means of this decision:
    1. Add "binding to sections" property to the selected infoblock and connect it to sections (collections) of infoblock Media library
    2. On the page of detail viewing of an element of the selected infoblock connect the bitrix:photogallery.detail.list component. Select an infoblock from parameters of a component "media library". As the SECTION_ID specify property in which the binding to the section of media library is stored.

Connection code sample: 
IncludeComponent("bitrix:photogallery.detail.list", "slider", array(
"IBLOCK_TYPE" => "medialinrary",
"IBLOCK_ID" => $MEDIA_IBLOCK_ID,
"BEHAVIOUR" => "SIMPLE",
"SECTION_ID" => $arResult["PROPERTIES"]["MEDIA_COLLECTION"]["VALUE"],
"ELEMENT_LAST_TYPE" => "count",
"ELEMENTS_LAST_COUNT" => "30",
"ELEMENT_SORT_FIELD" => "ID",
"ELEMENT_SORT_ORDER" => "asc",
"ELEMENT_SORT_FIELD1" => "",
"ELEMENT_SORT_ORDER1" => "desc",
"PROPERTY_CODE" => array(
0 => "APPROVE_ELEMENT",
1 => "PUBLIC_ELEMENT",
2 => "URL",
3 => "rating",
4 => "vote_count",
5 => "vote_sum",
6 => "",
),
"USE_DESC_PAGE" => "Y",
"PAGE_ELEMENTS" => "20",
"PAGE_NAVIGATION_TEMPLATE" => "",
"DETAIL_URL" => "/photos/#SECTION_ID#/#ELEMENT_ID#/",
"DETAIL_SLIDE_SHOW_URL" => "",
"SEARCH_URL" => "",
"CACHE_TYPE" => "N",
"CACHE_TIME" => "3600",
"SET_TITLE" => "Y",
"USE_PERMISSIONS" => "N",
"GROUP_PERMISSIONS" => array(
0 => "1",
),
"DATE_TIME_FORMAT" => "d.m.Y",
"SET_STATUS_404" => "Y",
"ADDITIONAL_SIGHTS" => array(
),
"PICTURES_SIGHT" => "real",
"SHOW_PAGE_NAVIGATION" => "none",
"ELEMENT_ID" => "",
"SLIDER_COUNT_CELL" => "2"
),
false,
array(
"ACTIVE_COMPONENT" => "Y"
)
);
comments powered by Disqus