我需要从 php cp 菜单向菜单项添加一个类似 facebook 的按钮 -
我正在考虑从每个菜单 div 中提取信息并在将其发送到 facebook 之前填充元数据
<div class="menu_content_cell">
<span class="menu_title"><?php echo $menuItem['item_name']?></span>
<?php if($menuItem['item_desc']) {?> <br />
<span class="menu_description"><?php echo $menuItem['item_desc']?></span><?php } ?>
</div>
填写
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:og="http://ogp.me/ns#"
xmlns:fb="http://www.facebook.com/2008/fbml">
<head>
<title>Sample</title>
<meta property="og:title" content="Site Name <?php echo $menuItem['item_name']?>"/>
<meta property="og:type" content="food"/>
<meta property="og:site_name" content="Site Name"/>
<meta property="og:description"
content="<?php echo $menuItem['item_desc']?>"/>
<meta http-equiv="refresh" content="0;url=http://www.sample.com/menu.php"/>
</head>
<body>
</body>
</html>
这是可能的,还是我叫错了树?
我该怎么做?也许如果我能为每个菜单项获得一个唯一的 id - 我相信这是可能的,但我正在努力将拼图的各个部分拼凑在一起
提前致谢