Let's take a look at the label below.
{Dede:field.tong_gg Php=yes}
if (@me = = "" | | Empty (@me))
@me = "<p> no </p>";
{/DEDE:FIELD.TONG_GG}
Note: @me: Is the value of the current field, you can assign a value to it in if, and then after the judgment ends its value becomes your assigned value, prints out
Here's a concrete approach:
Method One:
Use an If judgment statement, determine whether a field has something, there is output 1, no then 2, the following is the code load content page template
{dede:field.audio runphp= ' yes '}
if (@me <> ") @me =" Output this if there is something in the Audio field, support HTML code, and you can use @me in your code to invoke the Audio field value, but don't have double quotes. " ";
Else
@me = "If there is nothing in the audio field to output this, it also supports HTML code, and it is also possible to use @me in your code to invoke the Audio field value and not have double quotes." ";
{/dede:field.audio}
Audio is a field that you add yourself
Dedecms template dede tags using PHP and if Judgment statement method