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>

Post reply

Can't comment until