DedeCms Many enterprise websites made by the system are used Select drop-down menu The friendship link is displayed, but the friendship link call tag provided by Zhimeng CMS has no corresponding code to implement this function, so we will tell you two methods to implement the select drop-down friendship link.
The first one (recommended):
This method does not modify the source code of dedecms program, which is very convenient for system stability and later system upgrade and maintenance SQL To achieve.
Call code:
<select onchange="window.open(this.options[this.selectedIndex].value)" name="select">
{dede:sql sql="SELECT * FROM 'dede_flink' WHERE ischeck > 0 LIMIT 0,20"}
<option value="[field:url/]">[field:webname/]</option> {/dede:sql}
</select>
Second:
This method needs to modify the source code of dream weaving program.
Modification steps:
Find the file include/taglib/link.lib.php, edit it, and find the code in it:
else if($type=='image')
Add the following code to the code:
else if($type=='option')
{
$link = "<option value='".$ dbrow->url. "'>".cn_substr($dbrow->webname,$titlelen). "</option>";
}
Then add the following code to the template file that needs to call the drop-down friendship link:
<select>
<option selected="selected">– Friendly Links –</option>
{dede:flink row='24' type='option'/}
</select>
Statement: All articles on this site, unless otherwise specified or marked, are originally published on this site. No individual or organization is allowed to copy, embezzle, collect and publish the content of this website to any website, book and other media platforms without the consent of this website. If the content of this website infringes upon the legitimate rights and interests of the original author, please contact us for handling.