Limit the number of uploads per image field depending of role

Limit the number of uploads per image field depending of role

I need a hook (or something similar) where I can set the number of image uploads depending of the role of the user. In the settings of the field there is no way to set the maximum number of values users can enter, just one value for all roles. For example, for role #1... read more
Limit the number of uploads per image field depending of role

Referencing parent entity

I’ve just started with Drupal and I’m trying to create the following URL structure with PathAuto and Entity Reference: Category A -> Category B -> Category C Resulting in category_a/category_b/category_c For display purposes, I have to define the... read more
Limit the number of uploads per image field depending of role

Auto posting to Facebook page

I am using the Drupal for Facebook module on both a D6 and D7 site to post to a FB page (not a group or a personal account/wall) via streams. It is working fine except I would like the ‘Post to Facebook’ checkbox be automatically checked only when the node... read more
Limit the number of uploads per image field depending of role

Showing two colorbox windows side by side…or within one main frame?

I have a site that I’ve created for some fellow musicians to learn new songs. Generally we have a link to a Youtube video of a song then a link that opens up the tab (chords, lyrics, etc) for the song. Right now I have links that open those things up... read more
Limit the number of uploads per image field depending of role

How do I output XML schema?

I have set the REST server with the Services module. Also I’ve installed the Services Views module, created a new view that outputs the desired fields into XML. That’s working fine. How can I add XML schema to that output, so the XML will look like:... read more
Limit the number of uploads per image field depending of role

Port database queries

I have inherited a Drupal 6 site with some custom modules, all of which are making use of db_query(). Now I’m porting the site with all its modules to Drupal 7, and consequently have to adjust most of the database queries to work with the new DBTNG abstraction... read more
Limit the number of uploads per image field depending of role

How to print the raw value of a custom user field in comments

I want to print a custom user field of the commenters. It is an Link field (https://www.drupal.org/project/link). Some users have that field completed and other not. I’ve read a lot of posts related to this and tried several solutions. The only code that seems... read more
Limit the number of uploads per image field depending of role

Adding class to nested UL in menu

I’m creating my menu using view along with Bootstrap to create a mega menu style navigation. I’m having a problem with the nav showing expanded at times when you come to the site and or refresh. not all the time but more than I’d like. I am using:... read more
form_alter and #element_validate inside .module file

form_alter and #element_validate inside .module file

Inside my .module file, I have created a hook for alter register_form and add a password field with a custom field-validation: function xenforo_form_user_register_form_alter(&$form, DrupalCoreFormFormStateInterface $form_state) { $form[‘password’] =... read more
Limit the number of uploads per image field depending of role

Set value for new field automatically based on another field

I want to add a new date field to an existing content type, and set the new field automatically for existing nodes to be equal to another date field from that content type. For example, if the new field is called ‘Event date’, and there is an existing... read more
Limit the number of uploads per image field depending of role

ShareThis facebook posts previews are perfect, but posts empty images

I have been having problems with facebook integration, and I know there are lots of other posts about this as I’ve been looking through lots of them. I see plenty of information about FB picking the wrong image, but in my case, the image is correct, and the... read more
Limit the number of uploads per image field depending of role

How to add a custom field to views block

I have a view (block) created. When I modify the view block, I have only the field “block title” in the form. However they are 3 fields (block title, block description et block body) in a block of drupal (which I can create via /structure/block/add). So my... read more
Limit the number of uploads per image field depending of role

add_where() causes the view not to be displayed

have a page that features a few views based on content types. Each content type includes a keyword field. This page is reached from a short quiz. I’m trying to limit the content in the views based on responses in the quiz by pulling the $_POST data and comparing... read more
Limit the number of uploads per image field depending of role

Page View not showing on path’d page

I’m using Drupal 6 and I’m pretty sure I’m using Views 3. I created a page called All Events (alias: all-events) and created a view that displays as a page. Under Page Settings for the path option I put all-events. My problem is that I can see the... read more
Limit the number of uploads per image field depending of role

Computed field that displays the full username of the author

I am using a computed field and I want to display the field_first_name and field_last_name, which are properties of the user that created that node. I have been trying things, but it seems like $entity does not have a uid? I have no idea how to get load the user.... read more
Limit the number of uploads per image field depending of role

View modes are stuck on default view

I had my site for quite some time and just started to use the display suite view modes feature for changing the displays per node. I made new view modes and tried to change them for my nodes, but it seems that its just stuck on “default” view mode which is... read more
Limit the number of uploads per image field depending of role

What does "The provided host name is not valid for this server" mean?

I am running a Drupal 8 website, and when I browse to any page, I get a plain white page with just the following error message on it. The provided host name is not valid for this server. What does this mean? How do I fix this? read more
Limit the number of uploads per image field depending of role

Add custom operator for condition() in search_api

I am trying to implement hook_search_api_multi_query_alter but it seems ‘IN’ operator does not work here. I have to check condition on array. Any pointers for start building custom operator. function... read more
Limit the number of uploads per image field depending of role

Organic Groups let users with a particular role Edit/Delete content only in the group(s) they belong to

I am using Organic Groups and have a custom role say “A”. I want users with “A” role to be able to “edit/delete” any content only in the groups they belong to. I have tried setting up with base System and OG permissions and also... read more
Why does my Pie Chart only show 1 out of multiple fields?

Why does my Pie Chart only show 1 out of multiple fields?

I’m attempting to create a pie chart views block with Google Chart Tools. It has multiple fields with numeric values for each field. The column chart of it works great, as shown in this screenshot: But for some reason the corresponding pie chart always displays... read more