I recently encountered a problem, that is, the navigation of dedecms uses external links, but the original window does not look good when opened, and it is better to open a new window.
OK, Put Dog ... : (Recommended Learning: Weaving Dream CMS )
The following is a simple dede tag code. If there is any deficiencies, please give me some advice
Find the head.htm in the template and replace
<li><a href='[field:typeurl/]'>[field:typename/]</a></li>
with the following
<li> <a href='[field:typeurl/]' [field:id runphp='yes'] if(@me=='4'){ @me="target='_blank'";} else {@me="";}[/field:id]> [field:typename/] </a> </li>
Note: The 4 above is the ID of the column you want to open a new window, just write it like this.
If there are multiple, you can write them all at once. If there are 2 new windows that need to be opened, the code is as follows
<li> <a href='[field:typeurl/]' [field:id runphp='yes'] if(@me=='4'||@me=='5'){ @me="target='_blank'";} else {@me="";}[/field:id]> <span>[field:typename/]</span> </a> </li>
Here are the IDs of 4 and 5. All new windows will be opened, OK!
The above is the detailed content of How to open the external link column of DreamWeaver CMS navigation in a new window. For more information, please follow other related articles on the PHP Chinese website!