Check for condition in page template
I am now using fe_page template for my page. I need to check whether news module is used in that page or not. How can we check for that condition in page template? And in that condition I also need to check whether image exists for that news or not? How these conditions can be implemented in page template for meta tags?
I tried with html parsing for checking the div classes with mod_newslist. But it's not working. Is there any way to check this?
Check for condition in page template
Thanks for your reply. I will try to explain my case in detail.
I need to display meta tags in every page's head section. And I am using fe_page template in all pages. So I extended this page template and used this in all pages, so that I need to change the template only here, to get it reflected in all pages. Is this the correct method?
Secondly, I need to check a condition. That is,
1) If news module is used in that page and if it contains an image, then write the meta tag as "<meta name="twitter:card" content="summary_large_image">"
2) If news module is not used in that page, Then write the condition as <meta name="twitter:card" content="summary">
My question is, whether it is possible to check the conditions in fe_page template?
I tried with parseArticle hook, but the else condition doesn't work. Is there any method to check this condition?