drupal

Unserialize PHP data in python [duplicate]

跟風遠走 提交于 2019-12-29 06:44:06
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: How to read/make sense of a PHP serialised data string in python I'm using python to access a database which is managed by a Drupal install. The data I want to access in Drupal in saved in the database as a PHP serialized object. Are there any pre-built python modules which can deserialize a PHP serialized object into a python object? I've done some searching and come up with nothing. I realize I could write my

Why is my Drupal 8 module show Page not found?

戏子无情 提交于 2019-12-25 16:00:52
问题 I'm following the Modules, Routes and Controllers tutorial. However, I kept getting "Page not found" regardless of "Clear all cache". dino_roar.info.yml file: name: Dino ROAR type: module description: "ROAR at you" package: Custom core: 8.x dino_roar.routing.yml dino_says: path: /the/dino/says/ defaults: _controller: Drupal\dino_roar\Controller\RoarController::roar requirements: _permission: 'access content' and src/Controller/RoarController.php file: <?php namespace Drupal\dino_roar

Is it possible to have multiple cache entries depending on the language in drupal 8?

ε祈祈猫儿з 提交于 2019-12-25 09:05:19
问题 I have a complex variable {{course_type.title[language] | nl2br}} in my custom block template. language is the current sites language but the content is only delivered in the language of the time, when the cache was build. I do have languages in my render array and it works for {% trans %} commands in the twig template: return array( '#theme' => 'block__vt_course_offer', '#data' => $courseData, '#cache' => [ 'contexts' => ['languages'], 'tags' => $cacheTags, ] ); Is there a way to get Drupal

Disable link in dropdown menu but keep the css

柔情痞子 提交于 2019-12-25 08:33:30
问题 I have the following menu on jsfiddle : http://jsfiddle.net/aL7Xe/1000/ I disabled the "Bewerkingen" link with : a[href="/test4/disabled"] { pointer-events: none; } because its a dropdown menu, but when I use that code my css seems to dissapear, how can I fix this? or what code should I use to disable that link but still have my dropdown menu and css on it ? I am using Drupal so using # in the link is not going to work Thanks in advance for any help :) 回答1: Try this : <a href='#'>Bewerkingen<

Drupal feeds module : import excel file - every excel column as specified drupal field

吃可爱长大的小学妹 提交于 2019-12-25 08:08:08
问题 My installed modules: feeds , feeds_xls My excel file is : books.xlxs (office 2007) File sheets: my file have 15 sheets (this sheets must be as drupal taxonomy term) Every sheets involve 6 column (this column and its contents must be as drupal field content) I created a drupal content type with books name. I have attached an image to this post. you can see it. I want to import ecxel file into Drupal content.every row on this tables must import to drupal as a node) content). books Excel file

Drupal 8.2.x text editor stripping-removing “div classes”

徘徊边缘 提交于 2019-12-25 08:00:48
问题 I have a problem with Druapl 8.2.1 text editor and CKeditor, system keeps stripping - removing classes from " And example of this: <div class="social clearfix"> </div> System renders: <div> </div> I can't configure the allowed elements, that was only possible in previous versions (config.allowedContent = true;) Any help would be greatly appreciated 回答1: Ok, well after breaking my head thinking and re thinking in all I have already done I just did what it was left to do. Since there is no way

Drupal 7 - How to assign a variable to a template?

感情迁移 提交于 2019-12-25 07:48:35
问题 So..I have created a module called "moon". In the module, i use moon_menu to assign a menu that calls back moon_page to display something to the browser. function moon_page(){ $moonsvariable = 'hi this is a function'; return theme('moon_display',$moonsvariable); } is it possible to assign a custom variable to the template then use it in the template? I would like to it in the following way. function moon_page(){ $custom_variable = "this is a custom variable"; $moonsvariable = 'hi this is a

Drupal Administer

馋奶兔 提交于 2019-12-25 07:47:10
问题 How to rename drupal's admin directory as I already have a directory named "admin"? 回答1: As Bleadedu pointed out, Drupal has no "directories" in its URL. The urls you see are all so called " clean urls ", achieved with a nifty trick in Apache (the webserver) configuration. You could disable clean urls that will fix your problem, but may not be an option, if you rely on this feature for some reason. Another option is to use path module to circumvent this issue. This has downsides too, most

在linux上安装Drupal

懵懂的女人 提交于 2019-12-25 07:36:40
  前言:国内用drupal的并不太多,网上资料也很少。要注意的是drupal尽量别使用apt来安装,特别是ubuntu平台的drupal做出了一定的更改,会妨碍后期的学习和使用。在安装drupal前要先完成LAMP的搭建,如果没有安装可以参照我之前的文章http://www.cnblogs.com/HowToEncodingTheSingular-point/p/5116860.html或者使用tasksel安装,这里不再赘述。   一、下载源码包   登陆drupal.org选择相应版本进行下载,zip或者tar.gz随便选择一个就可以   之后使用md5sum校验所下载的文件   解压文件(也可使用tar等工具)   然后就可以看到具体的文件目录了,通过目录结构可以看到drupal的各个组成部分      二、配置路径   要想正常使用drupal就要将drupal源码放到网页服务器上,但是我推荐使用软连接的方式方便后续升级和修改。   使用ln -s 创建drupal到网页服务器根目录的软连接(apache的默认路径是/var/www/html,要根据自己的服务器进行相应修改),同时建议使用mv指令修改软连接的名字为drupal方便之后配置文件的编写和保证兼容性      三、安装   在正式安装之前,要在官网下载中文语言包,按照相应版本进行选择     

Drupal - dynamically add class to wrapping div based on panel pane content node type

你。 提交于 2019-12-25 07:21:27
问题 Am using the drupal 7 panels everywhere module and i have set up a panel page template for my homepage. Problem is I need to add a class to a wrapping div in the template that is dependant on the node type inside the panel pane which is inside the wrapper. This needs to be added dynamically as our site editors will be moving panel panes around a lot. i.e. a row from my template looks like this: <div class="content_wrapper"> <div id="main-content-row1" class="content"> <?php print render(