Tag Archives: Views

Drupal 7 – Update multiple nodes at once in a Views

Sometimes we may want to update multiple nodes at once. Views Bulk Operations may help if you want to set the same value for a field of multiple nodes. But if you want to set different values among a set of nodes, then Views Bulk Operations could not help.

In Drupal 6, the Editview module may help but unfortunately there is no Drupal 7 version. An alternative solution could be done by editablefields module.

1. Download and enable the module. (I used the 7.x-1.x-dev version)

2. Create a view with table format. (This is not necessary but better user interface)
Continue reading Drupal 7 – Update multiple nodes at once in a Views

Drupal 7 – Customize the exposed filter selection list

Yesterday we have talked about how to use selection list for selecting Entity reference in Views exposed filter.
Drupal 7 – Selection list for Entity reference in Views exposed filter

Now i want to have more control on the selection list. For example, i have a content type called competition and i want to limit the number of options in the Entity reference selection list. In this case, we have to create a custom module and alter the views_exposed_form.
Continue reading Drupal 7 – Customize the exposed filter selection list

Drupal 7 – Selection list for Entity reference in Views exposed filter

When you want to set an Entity reference field in Views exposed filter, it only allows free text input filter. But i want to have a selection list instead of a free text input.

Just simply go to the field setting page @ admin/structure/types/manage/<content-type>/fields/<field-name> and check the Render Views filters as select list option. Continue reading Drupal 7 – Selection list for Entity reference in Views exposed filter

Drupal 7 – Reference field option limit for hierarchy taxonomy

Update @ 2013-11-28: You can also consider using Taxonomy Term Reference Tree Widget suggested by kenorb. =D

When you have a hierarchy structure of taxonomy, the default selection list is not quite user friendly because it list out all the parent and child terms. Assume with want to attach a country and city terms to the Article content type. The most straight forward way is create one vocabulary with some countries as parent terms and some cities as child terms like the following list.
  — England
    — London
    — Manchester
  — France
    — Lyon
    — Paris

It turns on that when someone is adding a new article, he may select either a country term or a city term. That is probably not what we want.
Continue reading Drupal 7 – Reference field option limit for hierarchy taxonomy

Drupal 7 – Restrict Access by Role (403 Access Denied) for specific paths

Today i would like share another module about Drupal access permission. It is called Path Access.

With the help of the Empty Page module, i could create any blank templates with different blocks. But unlike Views page, these empty pages do not have access permission settings. Luckily the Path Access module could fill the gap.

If you have enabled the Path Access module, you can configure the forbidden paths for different roles @ admin/config/people/pathaccess.
Continue reading Drupal 7 – Restrict Access by Role (403 Access Denied) for specific paths

Drupal 7 – Show page not found if view argument exists

Assume we have a Views page which does not have a contextual filter setting and the view path is /eureka. If you provide an argument in the url such as /eureka/abc, the argument is ignored and the Views page will return all view rows. But sometimes we may want to show the user a page not found instead of return all rows. This can be done by adding a Global: Null argument in the contextual filter.
Continue reading Drupal 7 – Show page not found if view argument exists

Drupal 7 – Get number of nodes of Taxonomy Term in Views

About 2 months ago i published a post on how to get the number of nodes of a specific taxonomy term by term ID.
Drupal – Get number of nodes of Taxonomy Term by Term ID

Unfortunately, the taxonomy_term_count_nodes() no longer works in Drupal 7 but you can get the count by Views in D7.
Continue reading Drupal 7 – Get number of nodes of Taxonomy Term in Views