2012-11-29 105 views
1

我希望能夠預期<jdoc:include type="component" />何時未返回任何內容。在joomla中標記爲「在索引頁上顯示」的文章

事情是這樣的:

<?php if(count(<jdoc:include type="component" />)>=1) : ?> 
<jdoc:include type="component" /> 
<?php else :?> 
Sorry No Content 
<?php endif ; ?> 

找遍了,但無法找到任何東西,講了這一點。對不起,如果這是補救措施。

回答

0

我有這樣的片段進行檢測組件加載錯誤......不知道是否會爲您

<?php if ($this->getBuffer('message')) : ?> 
<div class="error"> 
<h2> Message </h2> 
<jdoc:include type="message" /> 
</div> 
<?php endif; ?> 
<jdoc:include type="component" /> 

運氣好工作!