drupal

Drupal Templating/Theming Resources or Advice?

。_饼干妹妹 提交于 2020-01-12 10:21:32
问题 I'm interested in creating a custom theme for a Drupal site I'm working on. I am new to Drupal, however I have a decent bit of experience in working with the underlying concepts that it seems are needed to build a theme (CSS, PHP, HTML). So, my question is - where do I start? Is there a canonical guide to creating Drupal themes? Resources that I should be aware of (other than the Theming Guide)? Gotchas that others have encountered, or just general words of wisdom from those who are more

Extract Url & Title from link field in Drupal 8?

爷,独闯天下 提交于 2020-01-11 15:28:33
问题 I'm trying to retrieve the URL and the Title values of a Link field in Drupal 8 . In my custom controller, I retrieve the nodes with: $storage = \Drupal::entityManager()->getStorage('node'); $nids = $storage->getQuery() ->condition('type', 'partners') ->condition('status', 1) ->execute(); $partners = $storage->loadMultiple($nids); When I loop throught all my nodes, to preprocess vars I'll give to my view, I would like to retrieve the URL and the Title . foreach ($partners as $key => $partner)

Why does my site change my CSS for me?

两盒软妹~` 提交于 2020-01-11 11:37:11
问题 I have jssor slideshow module installed on my drupal 8 site. I am trying to have the arrows on the slides to navigate the slideshow. The problem is something is adding display: none; to my arrows. When I remove the the line in the terminal the arrow appears but when I put my mouse back on the page out of the terminal window the arrow disappears and the display: none; line is back. What causes this and how can I stop it? 回答1: Have you tried adding display: block !important; ? I often have to

How to use password hasher snippet in Django?

无人久伴 提交于 2020-01-07 07:49:25
问题 I am trying to move Druap 7 site to django 1.7 without invalidating user passwords, and this proved to be daunting. Fortunately, I have found this SO question and this hashing snippet but there is no documentation and as a newbie to django, I have no clue how to integrate the snippet into my project. So greatly appreciate your help. 回答1: You can use PASSWORD_HASHERS Django uses first entry in that list to store password and all the other entries are valid hashers that can be used to check

Drupal hook_menu from module for admin menu

百般思念 提交于 2020-01-07 04:24:27
问题 I have a custom module "menu_mods" for adding menu items to the admin menu. It's not adding it. I want the link to show in the Navigation menu. I'm using the Garland theme for the admin pages. Here is my module code: function menu_mods_menu() { $items = array(); $items['admin/editfrontpage']=array( 'title'=>'Edit Homepage', 'description'=>'Edit Homepage.', 'page callback' => 'edit_front_page', 'access callback' => TRUE, 'type' => MENU_NORMAL_ITEM ); } function edit_front_page(){ $frontPageUrl

hook_preprocess_page() does not seem to use the suggested template file

霸气de小男生 提交于 2020-01-07 04:03:09
问题 I am suggesting a template file in the hook_preprocess_page() implementation done from a module, but the suggested template file doesn't seem to be used. The template file is page--terminal-template.tpl.php, which is in the directory containing the module, and this is the implementation of hook_preprocess_page() . function terminal_preprocess_page(&$variables) { if (arg(0) == "terminal") { $variables['theme_hook_suggestions'][] = "page__terminal_template"; } } Could anyone please help me? 回答1

Guzzle add CSRF token

不打扰是莪最后的温柔 提交于 2020-01-07 03:41:22
问题 I am trying to create a product in drupal commerce using guzzle and restful webservices. When i am trying to create a new product i use the following process: 1) Login as a user who has the rights to create a product (succes) 2) Request CSRF token (succes) 3) Create product : Uh oh!: Client error response [status code] 401 [reason phrase] Unauthorized: Access to this operation not granted Now when i am doing this process trough poster (Firfox add-on). I can succesfully create a product, but

Configuring NGINX to serve Ruby on Rails and Drupal websites

我是研究僧i 提交于 2020-01-07 03:17:09
问题 As I try to migrate my Drupal website from Bluehost to DigitalOcean, I am encountering difficulties with my nginx setup. I have a live Ruby on Rails app living in ~/Kiji and I'd like for the Drupal one to go into ~/EAS. Here is my current nginx.conf file (which isn't configured as I do not understand exactly what I need to change - I have taken the setup from this page) worker_processes 1; events { worker_connections 1024; } http { passenger_root /home/daniG2k/.rvm/gems/ruby-2.1.2/gems

Drupal 8: Mismatched entity and/or field definitions

爱⌒轻易说出口 提交于 2020-01-07 02:25:29
问题 While trying to understand why my view is not displaying, I noticed the following error in the log: I do not think it is possible to delete the URL alias from Taxonomy terms. At least I cannot find how to do this. I have, however gone through ALL of my taxonomy terms and removed the value for this field. I have also done the following with Pathauto: Also, I have checked the report located at admin/reports/fields and can confirm that there are no entities that use a field called URL alias. I

Drupal hook_submit write to db

删除回忆录丶 提交于 2020-01-07 01:52:08
问题 I am now taking on the challenge of building a custom module. I have started really small just to try and the understanding of drupal hooks and modules. I have created a simple form with one text entry, the only validation is that the field is not empty. On the form submit I would like to write to a custom table. The table exists. My fields are: nid int(11) eid int(11) Primary Key Auto Increment title varchar(50) Here is my form: function my_module_my_form($form_state) { $form['esp'] = array(