When Zhimeng DedeCMS publishes documents, some upload pictures, some do not have pictures, and the documents without pictures are replaced with Baidu/Google advertising pictures to make the article page display more consistent and beautiful.

The method is as follows:

Open the article template file: article_article.htm

Find the article content tag:

<table width='100%'>
<tr>
<td>{dede: field. body/} (responsible editor: {dede: adminname/})</td>
</tr>
</table>

Label the original article content: {dede: field. body/}

Replace with:

{dede:field name='body' runphp='yes'}
if(strpos(@me,'img')) @me=@me;
Else @ me='<div style="float: right;">Google ads are placed here</div>'@ me;

Post reply

Can't comment until