Questions tagged [7]

Version tags should be used for questions that apply to a version only, not to merely say what version a site is using.

Filter by
Sorted by
Tagged with
4
votes
1answer
389 views

How to limit what is available for a role in Administration menu ?

I am using Drupal 7 and installed the Administration menu. It works fine and I am really happy with it but after creating a new role, and also creating a new user for that role, he seems to have the ...
2
votes
1answer
685 views

How to implement Instant Notifications to 'follow' or 'like' nodes?

My employer has a social intranet site with 1000s of users, groups, communities and blogs. Users are free to 'follow' or 'like' nodes, blogs and other users, subscribe to communities, join groups etc. ...
0
votes
1answer
542 views

Integer user form field with min 11 digits and max 11 digits

I need an integer form field with has a validation of min 11 digits and max 11 digits. In other words; the user has to fill in an 11 digit code. How do i make this field and validation? Update: I ...
1
vote
2answers
461 views

Block changes do not save in admin/structure/block/ page

I have a large number of blocks in a Drupal website. Now I can not save changes in region and order of blocks in admin/structure/block/ page. There is no message at the top of the page, no Javascript ...
1
vote
1answer
696 views

How to prevent a node from being saved/updated by using the Rules module?

I've created a content type 'H'. The following rule (using the Rules module) has been built to prevent the node from being saved/updated if the field 'a' is larger than 5. Event: Before saving ...
1
vote
3answers
1k views

How to create charts in Views using Google Analytics data?

I'm trying to generate charts in Views using Google Analytics data. I have the Google Analytics Reports module installed, but this module doesn't allow aggregation of data which make charts very ...
0
votes
1answer
945 views

Remove an uploaded file

I am working with files in a Drupal module. I added this form: $form['Background_image'] = [ '#type' => 'managed_file', '#title' => t('Image'), '#...
6
votes
2answers
10k views

How to target specific sites with Drush when using Multisites?

I have a Drupal Multisite set up. It contains two sites, but the core Drupal install has no site. With Drush, I can use @sites to target all sites. For example: drush @sites -y cc all - Updates all ...
2
votes
1answer
560 views

drush perm-grant gives "The drush command 'perm-grant' could not be found"

I am using drush -u 15 perm-grant --roles="site administrator" but the command returns: The drush command 'perm-grant' could not be found. any ideas about that? according this documentation the ...
1
vote
2answers
728 views

Views, Pathauto and contextual filters

My question is rather simple, but I didn't manage to find anything that can help. Summary of my setup : Pathauto Views Entity Reference So I have various custom content types, which I want to ...
2
votes
1answer
919 views

Unable to set file upload destination private when programmatically creating new content type with file field

I am creating a module to upload video to an in house media converter - as part of the module installation I create a new content type called "user video" which has a file field as part of it. I need ...
0
votes
2answers
915 views

How to validate deletion of custom entity?

I'm making decently complex system, where many entities are referencing each other, and I don't want to allow any broken references. That is why I would like to implement validation at entity deletion,...
0
votes
1answer
27 views

How is the theme folder to use decided?

Under /sites/all/themes there are two folders called atlas and atlas.backup. Drupal 7 is pointing to atlas.backup and I don't understand how Drupal knows which theme folder to use. I want Drupal to ...
3
votes
5answers
3k views

Hide user's blog link on blog entries

I want to hide the user's blog link that appears on blog entries e.g Anonymous's blog How can I do this in node--blog.tpl.php? I tried hide($content['author']); but that doesn't seem to work.
1
vote
1answer
638 views

Importing shapefiles/kml

I need to add support for importing either kml file or shapefiles, preferably using feeds. The idea is that each record relates to a single node, and the file uploaded could contain hundreds of new ...
1
vote
2answers
692 views

How to add parameter to URL when passing ids as arguments to a page?

I have a view with an action Pass ids as arguments to a page where I need to add to the link. There is a parameter which I receive in the URL. I can print the parameter in the view, but I am not able ...
0
votes
1answer
430 views

How to add Table of Contents in a PDF?

I am using the Drupal Print module to create downloadable PDF from my site. This works very well indeed. But I would like to have a table of contents in the left region of the downloaded PDF. For ...
0
votes
1answer
554 views

I need to reference a custom field I created in User Profile

I used Drupal 7 computed fields to calculate weight loss. This is what I current have. Which works in a sense but only where the user inputs their initial weight and subtracts their current weight to ...
0
votes
3answers
594 views

Add an image to a line item in drupal commerce

my client ask a site to sell printed canvas so I need to allow site users to add at least one image to every drupal commerce line item. There is easier to start from a drupal kickstarter ...
1
vote
1answer
679 views

How to load field value to custom form?

I'm using Drupal 7 for my website. I created custom settings page with custom form in it, but the problem is I don't know proper way to load inserted value from database to my form after saving it, ...
1
vote
1answer
378 views

Drush not selecting database

I'm using a Vagrant environment generated from https://puphpet.com/ for a Drupal project & it is all going well except for Drush which gives me an error any time I try running "drush cc -all", see ...
0
votes
1answer
2k views

Progress bar advances, operations does nothing

I'm trying to create a batch to import users. I used this (http://pastebin.com/duTbxpgd) as an example, but somehow it's not working. I see the progress bar advancing and It's showing the right number ...
1
vote
1answer
672 views

How to override template for view mode of a entity within a module?

I see in theme suggestion array that I can override template for my custom entity type based on view mode like this: custom_entity__custom_entity__view_mode_name Now I want to put custom-...
1
vote
0answers
632 views

"Add to cart" form doesn't add products to the cart [closed]

I have an e-commerce site. In that, I have created product listing page using views. I have added the Add to cart field in the view, so every product in the view will have it. I have enabled view ...
1
vote
1answer
77 views

Add form to cart page

I'm wanting to add a custom form field to the DC cart page - not the add to cart page but the cart page. It wants to be specific to the cart rather than specific to individual line items which will ...
2
votes
2answers
4k views

Theme the "Add to cart" form on the product display page

I have a Drupal Commerce project setup on top of D7-22. I've overridden the template file for my product display (node--product-display.tpl.php), and have managed to render the product fields, as well ...
4
votes
3answers
6k views

"Add to cart" form with complicated attributes

I'm creating a Drupal Commerce based solution with 2 product types. One product has a constant price; it will be added to the cart, and that's all. The other product has many attributes (more ...
0
votes
1answer
648 views

External URL Redirect Breaking Image Links

I was recently hired to manage an existing Drupal 7 site (built with an Omega subtheme) and am doing my best to ramp up quickly. Unfortunately, I do have some fires to put out immediately and could ...
2
votes
1answer
886 views

Override a node page of specific content with views page

I want to create a views for overriding the node page for specific content. For example, when I click the link of a node in a list page, by default , it will go to the node page (e.g node/1), but I ...
0
votes
1answer
2k views

How to set a session variable when a link is clicked?

I have created a search block. It outputs multiple results (names) as links. User can follow the link. How can I pass the user name into $_SESSION variable? I tried doing this, the result shows a page ...
1
vote
3answers
3k views

How do I display a parent view term information when child terms exist?

I have two views set up: one that displays the image field, title, and description for each taxonomy terms in a vocabulary, and one that displays a grid of photos/nodes that are tagged with a taxonomy ...
0
votes
2answers
639 views

Remove Simplenews Newsletters?

I had set a content type to allow it to be used as a simplenews newsletter, and then updated the JSON Feeds Processor so that it filled in the simplenews category for all the items. However after ...
1
vote
1answer
919 views

Block overriding with template file doesn't work

The Drupal version I'm using is v7.34. I'm using sub-theme created from Bootstrap as base theme. My problem is, I want to override the "User Login Block" and put it in the header region (top bar), so ...
1
vote
1answer
538 views

How to override template for a Profile2 page

I'm working on a project which request, for a particular type of user, the need to choose a different template for the main profile page (public page). I need to override the main profile page but I ...
0
votes
1answer
551 views

Displaying titles of collapsed menus

I'm currently converting a mock-up and I need to display four menus in a list, the first two are expanded, and I need to display both the titles and menu items, and the next two are collapsed, so I ...
0
votes
2answers
538 views

Translation for node references not working properly

I have two content types: product feature and product. Both can be translated. If I create English product and assign many product features (by node reference inside field collection) and then create ...
1
vote
1answer
373 views

Migration of multi-value pictures to user fields

I need to migrate from a WordPress site to a Drupal 7 site where users could upload their own images (like multiple user pictures). I have a CSV file with the User's ID and a serialized array ...
1
vote
1answer
815 views

Profiles-2--user-edit-page

I made my custom user-profile-edit.tpl.php using function mytheme_theme($existing, $type, $theme, $path) { $hooks['user_profile_form'] = array( // Forms always take ...
7
votes
2answers
8k views

No one can login and access denied message

The site worked till yesterday and just now it's behaving strangely. The site is not created with features, an archive dump including the code and database is copied to server, and the old ...
1
vote
2answers
2k views

"File (Field) Paths" and "Media" modules: files not saved in the intended folder

I'm trying to use both the "Media" module (1.4) (to manage uploaded files) and the "File (Field) Paths" (to keep the uploaded files organized in various subfolders). Basically, I have a content type ...
1
vote
3answers
1k views

How to print the Views title in page.tpl.php?

I could print the view with this code in page.tpl.php. print $view->display['view_display_name']->display_options['title']; How can I print the Views title ?
0
votes
1answer
765 views

How to Center Image in View Slideshow

I can't get the views slideshow to center in the div. I tried the following code but with issue: #views_slideshow_cycle_main_content_slideshow-block { width: 100%; text-align: center; } #...
3
votes
1answer
1k views

Changing decimal field scale and precision using database

I'm using a custom decimal field in a custom product type in Drupal commerce. It has a precision of 10 and a scale of 2 (2 digits to the right of the decimal place). I have a client with a large ...
0
votes
2answers
374 views

Delayed error messages for webform blocks in template

I am printing a webform block in my node.tpl.php: <?php $block = module_invoke('webform', 'block_view', 'client-block-72'); print render($block['content']); ?> And when I ...
3
votes
3answers
2k views

How to add onclick event to a link?

I need to create a link, which when clicked should be able to set a session variable. I have used l() function to create the link and tried this but this is not working. 'name' => l(t($n['name']),...
0
votes
3answers
260 views

How to get searched item value in search form?

How do I get the value of searched item value, if I searched for "cat" in a search box then it also displays on a search page?
0
votes
1answer
711 views

Ubercart Ajax change attributes on checkout

I want to change the Product Attributes on checkout page by ajax. But when I save it by uc_order_product_save() in my ajax request and go to the preview step the attributes are gone. It seems that ...
2
votes
2answers
1k views

How to get child terms based on parent terms between two different taxonomies

I have created two vocabulary Program Topics I want to load the topics based on the program selection. It looks like category and subcategory. I created some program like java, .net, PHP and I ...
0
votes
1answer
576 views

How do I add images in pager for views nivo slider?

I am using Views Nivo Slider for displaying a slideshow of banner images on my site. And i wish to show the pager in the form of images. I tried using Image pager in views slideshow and it worked ...
7
votes
5answers
10k views

How to enable Drupal site to be in an iframe?

How can I enable a Drupal site to be in an iframe and place it in basic html page. If I try this: <iframe src="drupal-site.com"></iframe> then it doesn't show any result. Any ...