I
I
Ilya Voropaev2017-09-09 23:17:05
1C-Bitrix
Ilya Voropaev, 2017-09-09 23:17:05

How to implement custom widgets on a website?

Hello.
There is a task for a site on Bitrix to make custom widgets in sidebars on each page.
Now there are single widgets for the whole site such as "news", "banners", "photo from the gallery", etc.
It is necessary to be able to individually set the order and content of these widgets for each page.
those. on one page "news 1 2 3", "banners 4 5 6", and on the other "banners 6 4 8", "news 3 2 7" and "photo gallery 9 4 12".
How it is better to implement it?
While there are options:
1) make a separate settings infoblock and store all settings for each page in it
pros: using standard functionality
cons:
2) make a module and your tables with settings and bindings
pros: only the necessary functionality and potentially more convenient management
cons: make your own bike, and you may have to customize editing templates in the admin panel
3) use a ready-made solution like marketplace.1c-bitrix.ru/solutions /yenisite.infobl...
pros: a potentially simple solution to all problems
cons: ready-made solutions are often written in shit code, buggy and require serious improvements, and there is a big risk that in the future it will turn out that the functionality of the solution is not enough and you have to rewrite everything again without it
Maybe I Am I missing any other options or has anyone done this before?
Please share your experience if anyone has experienced this.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrey Nikolaev, 2017-09-11
@gromdron

Offhand, you missed the most interesting option: Implementation based on include areas for pages.
Pros:
+ Implementation of requirements based on the standard functionality of the product
+ Flexible expansion options (you can use any components on any pages with any parameters)
+ Use only the necessary minimum without interlayers in the form of infoblocks and databases
+ Simple and understandable control for the developer
Cons:
- Without an appropriate interface, the solution for simple content editors turns into HELL. If you support all this yourself, then there will be no problems, but for others you will need to develop an interface for creating an included area.

I
Ilya Voropaev, 2017-09-11
@SV0L0Ch

Thanks for the option, but unfortunately it is content managers who should work with this and part of the content is articles like news / services, etc. from infoblocks, i.e. include areas will not work.
So far, the main option is to make additional fields for related content in infoblocks, such as linking to infoblock elements (linking to news, galleries, banners), but it is not clear how to set the order of blocks in the sidebar.
Those. the main gag is in the "two-level settings" - for each element, you must not only set related elements, but also their individual sorting.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question