P
P
photosho2019-09-09 09:57:20
1C-Bitrix
photosho, 2019-09-09 09:57:20

How to check for content before showViewContent()?

It is necessary to display the content in h1 on the page using a deferred function (showViewContent()), but with a preliminary check: if it is empty, then display the page title (showTitle()). Is it possible to implement this using Bitrix tools, or is it easier to do it in js after the page is loaded?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Y
Yaroslav Alexandrov, 2019-09-09
@alexyarik

I would do this with SetPageProperty/ShowProperty on the site's new H1 property. In infoblocks, I would create a similar field H1. Here I already answered and in fact you will have the same essence:
How to display the section property in Bitrix?
For static pages, the site property will have to be manually added.

A
Andrey Nikolaev, 2019-09-09
@gromdron

Try it with CMain::GetViewContent

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question