V
V
Vitaly2018-12-23 12:33:49
1C-Bitrix
Vitaly, 2018-12-23 12:33:49

How to add a slider with a photo in the text of a Bitrix article?

The essence of the task:
The article is added as an element of the infoblock, written in a visual editor. The customer wants to be able to insert "a slider with photos (not 1 photo)" through the visual editor anywhere in the article (after a paragraph, for example) + be able to set text wrapping (right, left or center).
Given:
1. there can be several galleries in an article;
2. the content manager does not know the base html;
3. since the slider has a deep html structure and KM does not know html, displaying the slider code through the snippet and adding pictures one by one through the standard mechanism for adding pictures in the visual editor is not suitable!!!
My plan:
1. Create a multiple property type file.
2. In the article, in the right place, insert a "shortcode" like [gallery id="123" float="rigft"] wrapping it in a snippet.
3. Parse the article in the template and display the "gallery slider" instead of the "shortcode".
I understand that this is a "crutch-crutch", but what a lot ...
Tell me in the Bitrix format, can there be a more "correct" solution to the problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Gritsuk, 2018-12-23
@vcherepko

Create a separate infoblock for such galleries.
Gallery will be an element of this IB.
Gallery pictures are stored in a multiple property of the "file" type.
You can pre-think some kind of list property for different gallery templates.
Draw the conclusion as described here , adapting to your needs.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question