drupal-7

Linkedin Share is not fetching the thumbnail image while sharing?

a 夏天 提交于 2019-12-10 12:03:09
问题 I am trying to share linked-in for a page in drupal. In that page there is a image, still the thumbnail image is missing while sharing the page in linked-in. This is my linked-in sharing code. <a href='http://www.linkedin.com/shareArticle?mini=true&url=<?php print $tiny_bit_url;?>&title=<?php print $data->node_title;?>&summary=<?php print $summary; ?>'> <img src="linkedin-icon.png"/> </a> What is that I am missing w.r.t image being shared as thumbnail from that page to linked-in share. Thanks

PDOException: SQLSTATE[42S02]

烈酒焚心 提交于 2019-12-10 11:36:26
问题 I have just install Drupal 7 through microsoft web platform installer after successful installation when i run web matrix and run it. It show me this error I am new to drupal so have no clue what is this error and how to solve it 回答1: It's a simple problem to solve, just visit install.php on your website and you should be able to install as normal. Sometimes the installer doesn't automatically redirect to install.php and instead visits the root of the site. The exception happens because

Create a custom template file for a custom block in drupal

半腔热情 提交于 2019-12-10 10:25:09
问题 What is the drupal way to create a custom .tpl file for theming a custom block? Specifically I m trying to create a block programmatically and then find a way to separate the view code from the module php code. If it was a page the Drupal theme() would be very efficient way to achieve this. However I can't find what is the Drupal way to do the same thing for custom blocks. I 've tried to use the hook_theme() with no luck. //implementation of hook_block_info function mymodule_block_info() {

How to set a placeholder in drupal 7 on a login form

两盒软妹~` 提交于 2019-12-10 00:53:30
问题 I need to set a placeholder for a horizontal login form in Drupal 7. This text needs to disappear when clicked on. They will just say 'username' and 'password'. Here is the code for the form as of now. Thanks! function horizontal_login_block($form) { $form['#action'] = url($_GET['q'], array('query' => drupal_get_destination())); $form['#id'] = 'horizontal-login-block'; $form['#validate'] = user_login_default_validators(); $form['#submit'][] = 'user_login_submit'; $form['#prefix'] = '<div id=

Drupal 7 retain file upload

自作多情 提交于 2019-12-09 23:58:11
问题 I have a file upload form how can I retain this file when there are other validation errors so that the user doesn't have to upload the file again? I tried this in my validation function but it doesn't work: function mymodule_someform_validate($form, &$form_state) { $form_state["values"]["some_field"] = some_value; } the $form_state["values"] variable is not available in my form definition function - mymodule_someform($form, &$form_state) Any ideas? 回答1: Just use the managed_file type, it'll

Drupal 7 Views Contextual Filters

允我心安 提交于 2019-12-09 23:41:08
问题 I'm trying to create a view with a contextual filter on the title of the node and was wonder if there was a way to pass in a single letter as the argument and have the view return all node that begin with that letter? Currently I've not found a way to do this, I have to pass in the full title of the node for it to work properly. Thanks for any help. 回答1: To get this to work I had to provide a default value: And then I also had set up the Glossary Mode: I had set up the Glossary Mode before

How to apply multiple styles to one element in ckeditor?

自作多情 提交于 2019-12-09 20:16:45
问题 I want to integrate some bootstrap classes to my ckeditor profile: { name : 'Button Large' , element : 'a', attributes : { 'class' : 'btn-lg' } }, { name : 'Button Primary' , element : 'a', attributes : { 'class' : 'btn-primary' } }, but the problem is those styles cant be combined. If I want a button which is btn-primary AND btn-lg I would have to create a third style: { name : 'Button Large Primary' , element : 'a', attributes : { 'class' : 'btn-lg btn-primary' } }, which obviously is quite

How do you apply multiple conditions to a leftjoin on a db_select?

柔情痞子 提交于 2019-12-09 18:58:45
问题 I'm trying to join the Fivestar ratings for each node so I can sort them by rating. The problem is the Fivestar values I'm querying on are stored in votingapi_cache as multiple rows per node (vote count and the average rating), so I want to do the following: ... LEFT JOIN votingapi_cache fivestar ON fivestar.entity_id = node.nid AND fivestar.function = 'average' I've tried the following code, but the problem is the check on "fivestar.function = 'average'" is added to the where clause which

Drupal 7: How to alter image field widget “alt” or title" label

烈酒焚心 提交于 2019-12-09 18:47:46
问题 I am trying to change the "alt" and title" labels in the Image Widget on the node add form. I have tried both of these hooks: hook_field_widget_form_alter hook_form_alter I was unable to find where I needed to go to successfully alter the label. Could some one please direct me to the appropriate way to hook into this and alter them? I'm hitting these from a custom module if it makes a difference. Hitting them via the theme would be fine for me as well. Any ideas anyone? 回答1: You have to add

Delete field_group programmatically

不问归期 提交于 2019-12-09 18:10:32
问题 I have a field_group called "group_imagecache" in Drupal 7. How would I delete this programmatically? I have tried reading the code and it seems it uses ctools, but I would rather not use ctools. 回答1: ctools is a dependency of field_group. If you want to interact with field groups programmatically, you'll need to do so through ctools' API. Fortunately, it isn't hard in this case. Something like the following should work: if ($group = field_group_load_field_group($group_name, $entity_type,