I just enable the Search Form (provide by the search module) block to allow the visitor to make searches.  When a search is done the entered word is searched in all field of the nodes.    Can I exclude a field?  Let's say the content type has the fields: title, body and provider.  Then when a search is done I need to exclude the field provider from the search.  I have the custom_search module enabled but I see no way to exclude fields.
123691
If a content type has additional text fields, search core automatically indexes them because search core extracts all text from the result of node_view()  I can easily add extra index data via MODULE_node_update_index( $node ). This particular hook argument, $node, is passed by value and not by reference which means I can't unset certain items.   I hook into node_view, and alter it there but I don't want to change the output of the node normally, only when it's being indexed.
6328
Is there a way to hide the field label when rendering a custom field in Drupal 7?  In my node template I have:  &lt;?php print render($content['field_image']); ?&gt;   Which gives me:  &lt;div class="field field-name-field-image field-type-image field-label-above"&gt;   &lt;div class="field-label"&gt;Image:&amp;nbsp;&lt;/div&gt;   &lt;div class="field-items"&gt;     &lt;div class="field-item even"&gt;       &lt;img typeof="foaf:Image" src="http://site.com/sites/default/files/image.jpg" alt=""&gt;     &lt;/div&gt;   &lt;/div&gt; &lt;/div&gt;   I'd like to not have the &lt;div class="field-label"&gt;Image:&amp;nbsp;&lt;/div&gt;.  Is there a way to get rid of this other than in the CSS or manually creating the markup?   I've tried unset($content['field_image']['#title']), but that gives me &lt;div class="field-label"&gt;:&amp;nbsp;&lt;/div&gt;.
73530
In a Django form, how do I make a field read-only (or disabled)?  When the form is being used to create a new entry, all fields should be enabled - but when the record is in update mode some fields need to be read-only.  For example, when creating a new Item model, all fields must be editable, but while updating the record, is there a way to disable the sku field so that it is visible, but cannot be edited?  class Item(models.Model):     sku = models.CharField(max_length=50)     description = models.CharField(max_length=200)     added_by = models.ForeignKey(User)   class ItemForm(ModelForm):     class Meta:         model = Item         exclude = ('added_by')  def new_item_view(request):     if request.method == 'POST':         form = ItemForm(request.POST)         # Validate and save     else:             form = ItemForm()     # Render the view   Can class ItemForm be reused? What changes would be required in the ItemForm or Item model class? Would I need to write another class, "ItemUpdateForm", for updating the item?  def update_item_view(request):     if request.method == 'POST':         form = ItemUpdateForm(request.POST)         # Validate and save     else:         form = ItemUpdateForm()
3849
I created a new_form_mode for a content type in D8 and removed some fields in that form mode from Manage form display tab of the content type by selecting that new_form_mode . But how can i select that form should be displayed for that content type instead of default form mode?
106423
Sometimes when going back through e.g. my previous answers to find some information, I know the question I am looking for contains an image, and I know the language tag, but I'm a little hazy on the other parameters.    Is there a search option to restrict results to only those posts that contain an image? Akin to filtering email to show only those with attachments I guess.  I see that with  you can filter by user, votes, answer count or whether a question has an accepted answer, or has been closed or migrated. But not images?
17735
Let's say I have a node type "Article" which has a field "File" which is set to handle public files. A lot of articles and files get added.  Now the specs suddenly change and the "Article" will move behind a login and therefore also the attached files must be changed to be not publicly accessible anymore.  I already found out  pretty easily by reimporting the manually updated field.storage.node.field_file.yml config. But: this only affects new files that will be added after the switch. It doesn't work for existing files. They still are accessible publicly. Many thousand existing files would need to be manually reuploaded to also make them private.  Does anybody of you have solved that in D8 before? If so, then how?  As all I can think of right now is to programmatically query all "Article" nodes, then foreach through all nodes, get the files, temporarily store them somewhere else, empty the field out, then try to reupload the files programmatically (probably my next question) and then resave each node.  Does that sound reasonable? Or can you think of any other approach that might work here (in D8)?
12142
I was going to make a filter for the &quot;&quot; by excluding some sites from it.  I noticed  which talks about &quot;negative filtering&quot; but does not explain how one can do it or if it is possible.  There does not seem to be a way to do this, though.  On the filter page, my only options are:  So how can I do &quot;All sites except [list]&quot;? It would also be nice if this could include similar functionality with the meta checkbox.  Something like &quot;All main &amp; meta sites except...&quot;
85561
I've seen questions regarding  and , but this doesn't tell me why this field exists in the first place.  Do any internal processes use it, or are there any future plans for using it?
105831
Drupal 7. Custom module. I have a content type 'RFI' with a handful of fields I created with Drupal UI. I want a user to: fill out a form &amp; click submit while drupal: saves fields to database, creates a new node of 'RFI' and populates the fields of the node with the content provided by the form's corresponding fields.  From what I understand:  Build a form with fields (taking from the 'DBTNG examples' module just for clarity):  function rfi_build_form($form, &amp;$form_state) { $form = array();  $form['add'] = array( '#type'  =&gt; 'fieldset', '#title' =&gt; t('Add a person entry'), ); $form['add']['name'] = array( '#type'  =&gt; 'textfield', '#title' =&gt; t('Name'), '#size'  =&gt; 15, ); $form['add']['surname'] = array( '#type'  =&gt; 'textfield', '#title' =&gt; t('Surname'), '#size'  =&gt; 15, ); $form['add']['age'] = array( '#type'  =&gt; 'textfield', '#title' =&gt; t('Age'), '#size'  =&gt; 5, '#description' =&gt; t("Values greater than 127 will cause an exception. Try it - it's a    great example why exception handling is needed with DTBNG."), ); $form['add']['submit'] = array( '#type'  =&gt; 'submit', '#value' =&gt; t('Add'), ); return $form; }   Here the form fields are saved to database with database API.  function rfi_build_submit($form, &amp;$form_state) { global $user;  // Save the submitted entry. $entry = array( 'name'    =&gt; $form_state['values']['name'], 'surname' =&gt; $form_state['values']['surname'], 'age'     =&gt; $form_state['values']['age'], 'uid'     =&gt; $user-&gt;uid, ); $return = dbtng_example_entry_insert($entry); if ($return) { drupal_set_message(t("Created entry @entry", array('@entry' =&gt; print_r($entry, TRUE)))); } }   Now here is how I know how to create a node of RFI type. How do I take the values of the fields above [name], [surname], [age] and have them related to corresponding fields in my content type?  function rfi_build_type($form, &amp;$form_state){ $node = new stdClass(); $node-&gt;type = 'rfi'; $node-&gt;name = ''; $node-&gt;surname = ''; $node-&gt;age = ''; $node-&gt;language = 'en'; $node-&gt;uid = 1; node_save($node); }   I was thinking that since the fields have been saved already, that I could use a database query to get these values, but intuition tells me I'm overlooking something.  Thank you!
80789
I have a list with a bunch of attachments. A recent request came through to make these attachments searchable. Is the an attachment type that is searchable?
47540
I have been using the  module in Drupal 6 and am looking at the  for a Drupal 7 install. I have seen some discussion  but I am looking for any reasons for choosing one or the other.   Is there a reason to choose one over the other? If so, why or why not? I have heard there may be complexity issues and/or performance issues with Search API. Is this true?
80430
Question  Is there anyway to get rid of custom field in a managed package that has been referenced in a custom report type for that managed package?  Background  I've built a managed package and for some unknown reason installed several add on packages (s4twitter) into the managed package dev org.  We're no longer using these packages and are trying to rip them out.  However, one of the fields for the s4twitter package made it's way into a custom report type.  Before I can uninstall the s4twitter package I need to get the field out of the custom report type, but I'm blocked.  Is there anything I can do to untangle this mess and rip out the s4twitter package?
17998
I am trying to hide Authoring information, Revision information, Publishing options tabs in create/edit node for any content type. I tried different modules with no luck. Please give me suggestions how to achieve this. Thanks a lot
18062
If you start the title of a question with a construction like "[tag]", you get a red box telling you that:     Title contains a [tag] prefix; please use the tag field to enter tags instead.     And so, I can't title this post "[tag] prohibition in titles on meta sites is inappropriate". A travesty!  This blocking dialog is certainly appropriate on all main sites, but is not appropriate on meta sites (child and Meta.SE alike), where "[tag]" may legitimately be used at the beginning of a post title to refer to the main-site tag "[tag]". Enclosing tag names in square brackets is a somewhat-established convention (I guess because that's how you search for them), which is why I tried to do that.   Yes, I know I can work around this by rephrasing my title so that the tag name is not at the beginning of the title, or by not enclosing the tag name in brackets. Still should be changed, in my opinion.
97438
My "Article" nodes have a "domain" field that links to a taxonomy term. My "Article" nodes also have a repeatable "entity reference" field "more like this" that links to other "article" nodes.  How can i restrict the list in the "more like this" field to show only the nodes that have the same "taxonomy term" that the node i am currently editing ?  Thanks a lot !
44848
I'm using Drupal 7 and created a content type 'NewArticle' with the fields 'Title', 'Text' and 'Image'. Users have the permission to create a 'NewArticle', but I don't like the way of displaying the administration bar in order to let them create a 'NewArticle'.  Instead, I'd like to work with . My goal is to create a Webform with exactly the same fields as the content type 'NewArticle'. So what I want is: when users filled in the form and submit it, a new node 'NewArticle' is created with the submitted information.  How can I do this? Are there modules that make this possible? I can't find any...
120326
Currently, search seems to be doing odd things when you search for posts without certain tag(s) using the not operator. For example:  -[css] -[html] should return a list of posts that do not have the CSS or HTML tags, and it correctly looks for that criteria. However, it also seems to change my search query to "-[css] -[html]" (note the quotation marks) and searches for posts  which do not have the CSS and HTML tags, but also contain the words CSS and HTML within them.        The same thing happens whether you search for one or many tags. This doesn't seem to happen if you don't use the not operator on the tags.