M
M
Multigame2015-08-03 17:55:31
1C-Bitrix
Multigame, 2015-08-03 17:55:31

How to put information from a component into meta tags in Bitrix?

Good afternoon.
Tell me how to properly stuff information from a component on the page into meta tags. For example, generate FB meta tags for news pages by placing a photo from the announcement of the current news in og:image.
Interested in the "correct" solution that fits into the ideology of Bitrix. (in the sense of not 100% a crutch).
Thank you!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander, 2015-08-03
@Multigame

You first describe what you can't do.
The question is just too general.
Well, you need to display data there? Guess who's stopping you?
In the component template, in the component_epilog.php file, add the necessary meta tags to the header.
Or data from those that are not cached?
Or will multiple components compete on the same page?
Or do not know how to add a line to the header?
Or don't know how and where to create component_epilog.php?
In general - clarify the question.

$APPLICATION->AddHeadString('<meta src="'.$MySuperSrc.'";  data="superdata" rel="vabschesuperrel" />',true);

//

https://dev.1c-bitrix.ru/api_help/main/reference/c...

K
kompi, 2015-08-03
@kompi

A crutch system can only have crutches.
At the level of initialization by event, check the url and, by coincidence, take the necessary values ​​from the infoblock properties and add the necessary tags to the header.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question