Tag Archives: Drupal Development

Drupal – Limit the number of values of a content type field by role @ 2

Previous: Drupal – Limit the number of values of a content type field by role @ 1

Another way to limit the number of values of content type field is adding an extra validation on the node create/edit form. Assume we have a content type called center and a media field called field_center_video.
1. Create a custom module and add an extra validation. Continue reading Drupal – Limit the number of values of a content type field by role @ 2

Drupal 7 – Render the Privatemsg send message form programmatically

Privatemsg allows Drupal users sending message to each other. It is a must-have feature of community oriented websites. The module includes all necessary features including inbox, outbox, user block list etc. In my case, i want to render the send message form on the user profile page. So i created a block which generate the send message form by PHP code and attached it to the user profile page. Here you are.
Continue reading Drupal 7 – Render the Privatemsg send message form programmatically

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 – Render user profile picture programmatically @ 2

Yesterday we have talked about 2 normal ways to render the user profile picture in Drupal 7.
Drupal 7 – Render user profile picture programmatically @ 1

Unfortunately you can only get the user profile picture with default size if you have enabled the Gravatar integration moddule. i.e Continue reading Drupal 7 – Render user profile picture programmatically @ 2