In the near future, dedeis is used as a project. In case of a requirement, the imgurls field of a record in the additional table addonimages needs to be directly retrieved in the article_image.htm template. The content read by the secondary node changes with the gallery I selected, that is, the aid needs to be dynamically obtained.
Getting the value of the aid field makes me Tangle for a long time. Finally, I found it very simple. The template gets the id of the current document {dede: field. id /}As long as this sentence is used, the dede tag is still not skilled.
At first I wrote this:
{dede:loop table='dede_addonimages' if="aid={dede:field.aid/}"}[field:imgurls runphp='yes']echo '<pre>';echo $GLOBALS['a']=@me;echo '</pre>';[/field:imgurls]{/dede:loop}
The experiment failed because dede labels cannot be nested! (Except for the {dede: channelArtlist} tag)
Therefore, only one tag can be changed:
{dede:sql sql='SELECT imgurls FROM dede_addonimages where aid=~aid~'}[field:imgurls runphp='yes']echo '<pre>';echo $GLOBALS['a']=@me;echo '</pre>';[/field:imgurls]{/dede:sql}The browser output is successful. It turns out that {dede: SQL} is very powerful!