Answer the question
In order to leave comments, you need to log in
How to check if ShowMeta('') is empty in Bitrix?
Hello, you need to check if the description meta tag is empty
$APPLICATION->ShowMeta('description');
if (!empty ($APPLICATION->ShowMeta('description')) )does not work. How to check for emptiness? Or is it possible in some other way to set the default description to one, and if the field is filled in, then display it accordingly from the field?
Answer the question
In order to leave comments, you need to log in
To begin with, understand that at the moment of calling ShowMeta you have no data that they are filled. That is, it is NOT GOOD to check for emptiness there!
Check out the following documentation:
1) Delayed Function Mechanism
2) Page Execution Order
After reading it, you will understand that it will not work exactly the way you want. BUT!
You can write your own deferred function with its own behavior and get the desired result.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question