This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

Modify a Contrib Module

I am getting into developing Drupal modules and feel like I am kicking against the wall. After trying to find the answer on my own and failed I am deciding to join the Community and ask. I need some direction on modifying a current contrib module (project/physical). I would like to add override some of the functions in the module and add a couple of new options. I already have looked through the code and know what I need to change and the functions to override. I could just change the code, or copy the module and make my own, but those both seem wrong.

Custom template file for modules

Hello there, 

I have been trying all day to get some custom templates to load for pages and forms that I am creating programatically via custom modules. 

In several cases, I have a few forms which I am declaring as such in the hook_menu() implementation and drupal_get_form

When dpming out the $variables['theme_suggestions'] variable, one of the listed ones is page__form_name. I attempted to name my page page--form-name.tpl.php but the system didn't find it (even after clearing cache). 

Forms Show up Correctly on IE, Firefox but not Chrome

http://tworiversvideo.org/

Our services section and contact us web-form work on IE, Firefox and Safari but do not work in Chrome.

(should be obvious by big blank block)

I have taken over the IT position at this place and I am 100% new to Drupal, although I have used Wordpress in the past.

Hide content type property based on role

I have a content entity called Event and a basic custom module in 8.6.10. One of the entity's fields should only be seen by a few roles, especially in the edit form.

I thought I could create a new view mode for the form, but it's not clear to me how to restrict this view mode to these roles.

How to correctly add a placeholder to a query?

Hello friends,

I have a search query that uses a URL param.

I would like to insert this param into the query via place holder as this would be far more secure.

The way I am trying to do it is via the following:

$query->condition('a.dbl_title', '%' . ":search_term" . '%', 'LIKE', [':search_term' => $search_term]);

But this is not working and it looks like ':search_term' is just blank.

How would I go about correctly assigning ':search_term' to my variable $search_term??

Expiring the memcache cache for a purticular node

Dear geeks

I am in a situation that, drupal minimum cache lifetime affects my content updates periodically. if any changes made to a node content, it would only get reflected to anonymous users after reaching the minimum cache lifetime(Thats how it should work).
What i am looking for is, need to clear the cached version of the node which  is being updated. I use memcache for caching.

I had gone through the following code, but it won't expire the cached item.
 

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions