Drupal 8下面,为layout builder的配置页面单独设置主题
我们在项目开发中,经常使用最新的layout builder模块,同时还要使用Bootstrap。
遗憾的是,当前的bootstrap和Layout builder的兼容性并不好,样式比较混乱,为了简单起见,我们为layout builder的配置页面使用单独的主题。
在一个Drupal8站点,为特定页面单独指定主题,这是可行的,以我们这里的需求为例:
我们在项目开发中,经常使用最新的layout builder模块,同时还要使用Bootstrap。
遗憾的是,当前的bootstrap和Layout builder的兼容性并不好,样式比较混乱,为了简单起见,我们为layout builder的配置页面使用单独的主题。
在一个Drupal8站点,为特定页面单独指定主题,这是可行的,以我们这里的需求为例:
我们在开发Drupal8中,我们将一个Drupal网站分成多个频道,每个频道包含多个栏目和子栏目。
为了控制每个频道的样式,需要为html的body指定自己的class,经过研究可以使用hook_preprocess_html。
示例代码:
Mysql 从linux下面导出的sql,在xampp环境下面,导入,经常会报错误。经过检查是由于编码的问题。
在windows下面的命令行导入时,需要指定编码:
mysql -uroot -p --default-character-set=utf8 create database mydb; use mydb; source mydb.sql;
这样导入,就会很顺利。
问题:
You don't have permission to access / on this server apache 2.2.15
检查日志发现问题:
htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable
搜索:
原因,启用了selinux,导致不正常。
ios版本下面,media模块提供的上传,一致存在问题,用户无法滚动到下面,点击保存按钮。
media 模块,media/templates下面的模板文件,增加了以下内容:
<div class="mainContainer-scroll" style="position:absolute;height:100%;width:100%;top:0;left:0;-webkit-overflow-scrolling: touch;-webkit-transform: translate3d(0, 0, 0);overflow-y:scroll;">
<div class="Content" style="height:2000px;width:100%;">
...
</div>
</div>
解决ios下面,无法滚动到下面的问题。增加CSS
.ui-dialog.media-wrapper{
问题描述:
用户的视频播放,总是存在问题,苹果下面播放不了,我采取了趋势,android的可以了,但是苹果不行。
后来无意中发现,竟然是客户网站采用私有文件系统导致的,同样的视频,在公开的文件系统下面就可以。原来的文件都存储成了私有格式,也不便于直接转换回来。我查找了一下,有这个一个模块,刚好解决这个问题。
Drupal does not support download resume , meaning that downloading large private files can be troublesome because if for any
reason the download fails , there is no way to continue downloading from where it stopped and the whole file should be
downloaded again.
It also supports several extra features
我们经常会遇到一个实体多个类型,每个类型有自己的字段,这个在Drupal里面默认支持。
但是在NodeJS和MongoDB下面如何实现呢。
我找了几篇文章
Polymorphic user model with mongoose and node.js
https://stackoverflow.com/questions/24561182/polymorphic-user-model-with-mongoose-and-node-js
http://thecodebarbarian.com/2015/07/24/guide-to-mongoose-discriminators
注意这两个单词:
Polymorphic : 多态
discriminators:辨别者,鉴别器
使用no_cache这个配置选项,示例如下
mydownload.downloadlist:
path: '/mydownloads/{resource_type}/{resource_id}'
defaults:
_controller: '\Drupal\mydownload\Controller\MyDownloadController::downloadList'
_title: 'Download'
requirements:
_custom_access: '\Drupal\mydownload\Controller\MyDownloadController::access'
resource_type: '[a-z0-9_]+'
options:
no_cache: 'TRUE'