Chapabu
  • Member for 10 years, 2 months
  • Last seen more than 2 years ago
2 answers
1 votes
3k views
Which is the better module for shopping cart?
Accepted answer
6 votes

From the sounds of it, you actually want a whole e-commerce system, not just a shopping cart. Ubercart will do this for you, but the general trend now is to go with Drupal Commerce (project page | ...

View answer
2 answers
4 votes
6k views
Populate a select box with a vocabulary
Accepted answer
6 votes

You should be able to use the taxonomy_get_tree function to get all the children of the term, and then just run a foreach() on that. Example: function mymodule_blah($vocabulary) { $terms = ...

View answer
1 answers
4 votes
6k views
How does the Drupal template engine work?
6 votes

The Theming Guide is a good place to start. Also the Theming Drupal 6 and 7 pages should be of some help to you (more specifically, How the Drupal theme system works). Theming guide: This ...

View answer
3 answers
4 votes
3k views
How to create a hit counter for each published node to find out how often a specific node has been viewed?
Accepted answer
6 votes

There is a settings page at admin/reports/settings, try looking there first. Also, look in the node_counter table instead of accesslog. The query should actually be as follows ($nid being the node ...

View answer
1 answers
0 votes
1k views
Drupal 7 Is the a way to programmatically know the Fields in a Content Type?
Accepted answer
5 votes

field_info_instances(); will get you a list of all field types on a specific entity/bundle. For example: $fields = field_info_instances('node', 'movie'); print_r($fields); Will give you a list of ...

View answer
14 answers
15 votes
20k views
Can I delete nodes of a given content type with Drush?
Accepted answer
5 votes

You could create a function like follows: function MYMODULE_delete_all_the_things() { $query = new EntityFieldQuery; $result = $query->entityCondition('entity_type', 'node') ->...

View answer
2 answers
2 votes
2k views
The best way to store drupal Configuration
Accepted answer
5 votes

If you're literally looking for variable storage, then variable_set() and variable_get() are the way to go...during development. However - that means the variables are stored in the DB rather than ...

View answer
2 answers
3 votes
118 views
How to share Drush code with the community?
5 votes

If it's a useful Drush command, and one that you could see being used on a daily basis, the I'd suggest heading to the Drush issue queue and posting a feature request. Then answer the feature request ...

View answer
2 answers
5 votes
371 views
Will Lime the future test suite?
5 votes

Not sure about Lime, but Drupal 8 is set to use PHPUnit. See Deploy a PHPUnit system with a bottom-up approach. Deploy a PHPUnit system with a bottom-up approach Issue Summary Replace the ...

View answer
1 answers
0 votes
200 views
Drupal equivalent of Starkers
Accepted answer
5 votes

If you're looking for clean and easy base themes, there's Stark (which has a contrib version, as well as the version in Drupal core) This contrib version of Stark is an exact copy of the one in ...

View answer
3 answers
4 votes
140 views
OK to replace images on server?
Accepted answer
5 votes

I've never had any problems just replacing images. If there are any images that have image styles applied then don't forget to clear the image styles caches/files so they get regenerated as well. ...

View answer
5 answers
5 votes
10k views
How to set type="email" attribute on a Drupal form textfield
Accepted answer
5 votes

As it stands, Drupal core doesn't support all HTML5 form elements. The Elements module will add some support though, so check that out. HTML5 elements (url, email, search, tel, number, range)

View answer
2 answers
1 votes
293 views
building a complex frontpage
Accepted answer
5 votes

I know you said you didn't want to use it, but this is a PERFECT use case for Panels. I'm not a huge Panels user and will generally steer clear of it if I can, but sometimes you have to step outside ...

View answer
1 answers
3 votes
194 views
Allow another role to edit only parts of any node
Accepted answer
5 votes

The Field Permissions module will allow you to do exactly this. The Field Permissions module allows site administrators to set field-level permissions to edit, view and create fields on any ...

View answer
2 answers
-2 votes
1k views
How can I create a user account when a node is created?
Accepted answer
5 votes

You should be able to use Rules for this. Create a new rule that has After saving new content as the Event and then set any conditions that you have (node type etc). Then in the actions section, add ...

View answer
2 answers
1 votes
3k views
When a user login fails, is it possible to say "Password incorrect" or "Username does not exist" instead of the default message?
Accepted answer
5 votes

This message is set in user.module in the user_login_final_validate() function. It's set as a bog-standard form_set_error() so can't really be over-ridden. Looking at it, it also doesn't ...

View answer
3 answers
3 votes
774 views
When the "Body" field is required, how can I force users to input, say, at least 400 characters?
Accepted answer
5 votes

You should be able to just use the Field validation module to set a minimum length on the body field. This module adds an extra tab to each field instance, allowing you to specify validation ...

View answer
1 answers
0 votes
2k views
Make phone calls from a Drupal site
5 votes

You could use the tel: or callto: href identifiers depending on the method of your phone call (Skype uses callto:, mobiles that support this feature will use tel:. For example, if the number is 123-...

View answer
4 answers
0 votes
4k views
Removing "node" path from "node/add/*" URLs
Accepted answer
5 votes

If you go to admin/config/search/path/add then you can easily alias node/add/type to whatever you want. For example, if you're using a node type called contact-form for a contact page, then just add ...

View answer
3 answers
2 votes
3k views
Redirect user to login page when they have to access to a view?
Accepted answer
5 votes

The Redirect 403 to User Login module should do what you need.

View answer
3 answers
1 votes
7k views
How to disable copy and paste in webform textarea?
Accepted answer
5 votes

I've not tested this code, but a quick Google search suggests the following (obviously change #Password to the ID of your textarea field). $(document).ready(function() { $('#Password').bind('cut ...

View answer
3 answers
4 votes
5k views
How can I do a custom form redirect on the user registration form?
5 votes

Login Toboggan has an option for this whereby you can use %uid as an argument for the redirect URL. Literally a text box where you'd type /user/!uid/edit It's also got a whole host of awesome ...

View answer
2 answers
-2 votes
2k views
Error when using the Domain Access module
4 votes

You can access the readme file here. There is also a quickstart version here. The main bit you will need is the following (taken from the quickstart version - line 24): Add the following four ...

View answer
2 answers
3 votes
5k views
Display user's name instead of username
Accepted answer
4 votes

I'd add a new field called Display Name (or similar), then then use hook__user_format_name_alter() to load in that field, and change the display name to use the field value instead of the user name. ...

View answer
1 answers
1 votes
131 views
Why is it considered improper to directly add an `onclick` attribute to an HTML element?
4 votes

There's a good answer in the JavaScript subreddit on reddit here. To summarise, here are the reasons provided: tight coupling between presentation and behavior code runs in the global scope ...

View answer
2 answers
1 votes
48 views
How to make my new administration page use my administration theme?
Accepted answer
4 votes

There's a permission named View the administration theme. This should be given to the accountant role to allow users with that role to view the admin theme instead of the site theme. If that ...

View answer
2 answers
1 votes
1k views
How to query the Database logs and create summary reports and/or charts of them?
Accepted answer
4 votes

The Views Watchdog module might be useful. The Views Watchdog module extends the Views module and allows to create customized lists (pages, blocks, feeds) of watchdog entries. Combine it with ...

View answer
2 answers
2 votes
8k views
Drush Enable a module and all its submodules
Accepted answer
4 votes

There's nothing out of the box, however you can just list the three modules and then coder will also be enabled as it's a dependency. E.g. drush en coder_review coder_sniffer coder_upgrade -y If there ...

View answer
6 answers
6 votes
2k views
Is there an equivalent of view modes for form editing?
4 votes

1 - Panels/Page Manager If you're using Panels and Page Manager (part of Chaos Tools) then you can break up the node/add form by enabling/overriding the node_edit page manager handler and creating a ...

View answer
1 answers
0 votes
396 views
PHP Select options in CCK field
Accepted answer
4 votes

Your PHP is incorrect :( The second line should read $name = $user->name;.

View answer
1
2
3 4 5
13