乱,笔记用
<html >
<head></head>
<body>
<div id="wrapwrap">
<header>
</header>
<main>
<div id="wrap" ></div>
</main>
<footer>
</footer>
</div>
</body>
</html>
上述主体框架建议别动,替换样式即可,测试过,改了其主题框架导致使用Odoo website编辑页面功能时无法添加区块。
Odoo Website多语言切换原生为,打开链接的方式,做成下拉式菜单时候,发现<a>不能取消其 class ="js_change_lang",否则会导致无法跳转,没有深究原因。
联系我们页面,自带的地图貌似py生成的带链接的图片,花了一天的时间,改了效果。使用了 gmaps.js,代码如下:
//在页面需要引用的库:
<script src="http://maps.google.com/maps/api/js?sensor=true" type="text/javascript"/>
<script src="/模块路径/static/lib/plugins/gmaps/gmaps.js" type="text/javascript"/>
<script type="text/javascript">
jQuery(document).ready(function() {
ContactUs.init();
});
</script>
//实现方法
var ContactUs = function () {
//取联系我们页面html元素
var name = $("span[itemprop='name']").eq(0).text();
var address = $("span[itemprop='streetAddress']").eq(0).text();
var telephone = $("span[itemprop='telephone']").eq(0).text();
var email = $("span[itemprop='email']").eq(0).text();
return {
//main function to initiate the module
init: function () {
var map;
$(document).ready(function(){
map = new GMaps({
el: '#map',
lat: 30.581084,
lng: 114.3162,
zoom: 15,
zoomControl: true,
zoomControlOptions: {
style: google.maps.ZoomControlStyle.SMALL,
},
panControl: false,
scaleControl:false,
mapTypeId: google.maps.MapTypeId.ROADMAP,
mapTypeControl: false
});
//lat:纬度;lng:经度
$(function (){
GMaps.geocode({
address: address,
callback: function(results, status){
if(status=='OK'){
var latlng = results[0].geometry.location;
map.setCenter(latlng.lat(), latlng.lng());
var marker = map.addMarker({
lat: latlng.lat(),
lng: latlng.lng(),
title: name,
infoWindow: {
content: "<b>"+name+"</b><br>"+address+"<br>"+telephone+"<br>"+ ""+email+""
}
});
marker.infoWindow.open(map, marker);
}
}
});
});
});
}
};
}();