texts: I'm moving a bunch of info from an xml feed into drupal nodes. I'm a little hung up on adding the image. I'm using php copy() to copy the image from a url to my drupal directory. From here, I'm not sure how to insert the field info into the node in such a way that an fid and all of the required data is generated. What is the preferred way to do this?


texts: How to compare the already saved value of node and updated value?

texts: I want to programmatically compare a field value of a node in hook_node_update(). How can I get the already saved and the updated values?


texts: Drupal 7.0 Views 7.x-3.14 Time-based cache is not functioning as expected

texts:
I must admit some of this caching stuff is over my head, so this may be a misunderstanding on my part of how this is supposed to function.

But essentially I have a View with the following traits:

pulling six different fields (2 text, 2 date, 1 boolean, 1 image - although that's just a text string too, right?)
four filters with two exposed to users
full pager showing 15 items per page (30+ items was making mysql go away)
sorted by date and sticky
time-based cache is turned on. Settings: query results-never,
rendered output-5 mins

Amount of data being pulled is huge: over 4,700 records

Only other caching solution on the site is stock Drupal page caching for anonymous and blocks, both enabled.
Cron is running every day although I suspect it fails sometimes.

The default filters are supposed to show all events from "time - now" until there are no more future event nodes.

Problem is, the cache sometimes shows "Now" as being yesterday or two days ago.

Shouldn't the cache refresh every five minutes? Am I misunderstanding how this setting works?
Shouldn't the View show up-to-date data even if cron doesn't run, or is cache expiration dependent on the cron running successfully? Or is the stock Drupal page cache overriding the Views cache for anonymous users?

Thanks!


texts:
I am searching for a way to make a block behave as a drupal-highlighted area, similar to the header here. In other words, stick to the header and move along as the user roles down.

I was wondering if there is either a module that can do that, to sort of wrap the block's content or a custom workaround in my module.

I know that there exist some themes which can do that, but I would like to implement a theme-free solution.

Thanks!


texts: How to skip the description step when uploading a file for a specific field?

texts:
in the media module's settings, there's a checkbox called "Skip available fields" that lets you skip filling out fields that are attached to your media when you add one.

In some cases, we need to let users enter a description for files that are uploaded and in other cases, no.

Does anybody know how to skip the available fields for a specific field of a specific content type ?  What kind of code or hook implementation is required, etc. ...

Thanks !


texts: how to create all dynamic ubercart product images for CDN module to sync

texts:
I have enable CDN module to handle image/css and js requests from a static server.
As drupal creates product images for different styles dynamically there are many products whose images are not present at the time to CDN and my domains syncing of images.
How can i handle the request to new product images in this scenario >
Right now the missing images are coming blank


texts: Is there a way or module that allows me to move the search tab of the People page to the List tab?


texts:
I have a content type called advanced forum topic, which is created from the Advanced Forum module.

I would like to have 3 different kinds of topics(General, Player, Team).
Each of this has different fields. My thought was to organize these into Field collections. Is there a way that I can choose the topic type with a dropdown menu and then the rest of the fields in the collection would pop up dynamically?


texts:
Does anyone know of a way to force plain text mode in comments for all roles?

Edit: is it in any way possible to do so through CSS? Thanks!


texts: Want to filter result by using two filters "event start day" and "event start time" in one view for showing upcomming events?

texts:
I want to show a view of upcoming events. I have added event start day filter to my view, it's showing today's events as well as upcoming events.

This functionality is working fine but problem is that  it's showing all  events of today not on the basis of time but it's showing morning's event whose time is passed away. It must only filter the values on the basis of current time and coming time(current day and upcoming days).

I want to add one more filter event start time filter. How to add two filters(event start date and event start time) in one view?


texts: How do I create the template file for the form to add a new node?

texts: I need to create the template file for the form used to add a new node, in order to change its layout for other users.


texts: Term Reference field as checkboxes, not auto-complete?

texts:
I have a brand new Drupal 8 installation (my first D8 site). I've created a new content type with a Term Reference field.

When adding content, it appears that the only way to select a term is via type ahead, auto-complete. Instead, I need a simple list of terms with checkboxes.

I can't recall struggling with this in D7 before. Is there a module I should install... or setting that I should configure?


texts: Can the profile2 fields in registration be made obligatory?

texts:
I have a profile2 profile type in which I want to expose some fields to the user when registering.

Is there a way to make a field obligatory?


texts: Entity Query returns incorrect results while running functional javascript test

texts:
Im writing a functional javascript test for my project where im facing a problem with my feature. I have created a group entity just above it and referencing a parent group.
This doesn't work:
  $query = \Drupal::entityQuery('group')
        ->condition('field_parent_site', $group->id());
      $gids = $query->execute();

This works:
  $connection = \Drupal::database();
  $query = $connection->select('group__field_parent_site', 'p');
  $query->fields('p', ['entity_id']);
  $query->condition('p.field_parent_site_target_id', $group->id());
  $result = $query->execute();

I even tried resetting cache programmatically but that too had no effect. I don't have any problem with it while testing it through browser.


texts: Access description field for file in a view

texts:
Gents, I have two fields that accept multiple file uploads.  One of those fields has file descriptions enabled.  I need to access those field descriptions in my view, but I don't see the file description field popping up in the list of available file fields.

I've added the relationship fid for the field that has multiple files associated with it.

So, I'm confused as to how I'm supposed to get the file description view exposed.  How do I do so?

Let me know if I need to clarify further.


texts: How do I get the result from a database and show it?

texts:
I have a database table with the following fields: name, company_name, geo_loction. I want to get those fields using the following query.

$zip_code = db_query("SELECT * FROM data_set WHERE id = 1", array(":city" => $city))->fetchObject();

Is that the correct code? How do I show the result?


texts: Restrict a role to administer certain vocabularies and terms, and remove the access to creating vocabularies

texts:
As far as we all know Drupal (still in D8) has a lot of issues with permissions and taxonomies.

So I give my user role the permission to Administer vocabularies and terms so he/she be able to access the page at admin/structure/taxonomy but then I want to restrict that role to certain vocabularies (then Vocabulary Permissions Per Role module comes in handy)

The only issue that remains is the Add Vocabulary permission that comes with Administer vocabularies and terms

So here's the question: How can I restrict the user from Creating new vocabulary / Editing existing vocabularies while giving access to maintain other vocabularies taxonomy terms?


texts: Implementing direction of a 1:n relation with entity-reference

texts:
Consider two content types A and B which are in a 1:n relation (say any A entity will be referenced by n entities of type B).
Implementing such a relation with entity-reference fields can be done in 2 ways:

content type A holds the relations:

CT A has its own fields plus one multi-value entity-reference type filed that will store the references to all the B type entities
CT B has only its own fields

content type B holds the relations:

CT A has only its own fields
CT B has its own fields plus one single-value entity-reference type field that will store the reference of each B entity to its own
parent A type entity.

With the first implementation (A type with a multi-value field) I give the user the possibility to sort the related entities, which is not possible with the second implementation.

Is there anything, on the contrary, that is possible to realize with the second implementation but not possible with the first one?


texts: Migrate content profile to Drupal 7. Failing with source plugin exception - Unknown Column

texts:
I am struggling with setting up a migration from a Drupal 6 site to a Drupal 7 site. The Drupal 6 site used Content Profile nodes to store some user information that in the new site will be fields attached to the user account. I am using the Migrate module along with migrate_d2d. I have tried setting up with the migrate_d2d UI as well as writing a custom module to define the migration based off the migrate_d2d example.

Migration failed with source plugin exception:

  SQLSTATE[42S22]: Column not found: 1054 Unknown column
  'f.field_profile_other_value' in 'field list', in
  includes/database/database.inc:2170

This field_profile_other is one of the content_profile fields in the D6 site. I checked the database the column in the error message is present and has data in it. I doesn't matter what I map this field to, I get the same error every time. I have tried marking the field not to be mapped to no avail.

The migrate_d2d code has functions in it that deal with content_profile data, so it appears to be something it is prepared to migrate. I am a loss as to proceed. Any help would be much appreciated.


texts: How to Replace Value of CKEditor Field via Custom Module

texts:
Drupal 8.x

I have a custom module and I am trying to wrap any string beginning with a hash tag in an 'a' tag via RegEx.

MYMODULE.module:

function MYMODULE_preprocess_node(&$variables) {

    if ($variables['elements']['#node']->get('field_name')->value != '') {

        kpr($variables['elements']['#node']->get('field_name')->value);
        $variables['elements']['#node']->get('field_name')->value = $newValue;
        kpr($variables['elements']['#node']->get('field_name')->value);

    }

}

I've left the two kpr() statements which do show initial value, and the RegEx replaced value, correctly. However, the value of the CKEditor field is not being replaced. It appears my 'equals' operator has no effect.

How do I replace the value of the CKEditor with my updated value?

Referencing this Stackoverflow question: https://stackoverflow.com/questions/22040272/using-php-replace-regex-with-regex


texts:
I have a site with drupal commons distribution. I updated the existing content type to add some fields which made the feature in overriden state. Now, I am not sure the best practice to follow. Should I update the feature in profiles/commons/modules/... or is there another way to update the existing content type without changing the default code? Should I move all profile modules under sites/all/modules/...?
Please help me to follow the best practices.
Thank you.


texts:
I face new problem in my site, we have reports from users that when they are surfing our site with their account, suddenly logged in as another user and continue surfing site as it.

I searched all modules for below patterns to find where global $user changed by mistake but found nothing.

$user->uid =
$user =
->uid =

Is there any suggestion about this issue?


texts:
In my academic website, I need to add graduation year as a date field but for month field, I want to add only two month (May and December).

Can I do this?

My professor want like this and i don't have any idea to solve my situation.

Can you help me?


texts:
I am using the facets module to add filter blocks in my view.
I have a list field wich contains

FR|France
IT|Italy

My dropdown list of facet display values (fr, it)
I want to display (France, Italy)
How can I do that?
Thank you


texts:
I want to pass params via Drupal to my JS file. I have no problem fetching them with the code below,
the problem is that as the  $(document).bind('leaflet.map'  function executes FIRST, it is not able to find the
user_name parameter

my_module.module

  function my_module_preprocess_html(&$variables) {

  $user_name=$GLOBALS['user']->name;
  drupal_add_js(array('my_module' => array('user_name' => $user_name)), array('type' => 'setting'));
  drupal_add_js(drupal_get_path('module', 'my_module') . '/js/external.js');
  }

external.js

(function($) {

Drupal.behaviors.fewo_map= {

 attach: function (context, settings) {

 alert('get params');
 //we can fetch the data
 user_name=settings.fewo_map.user_name;
}

}

$(document).bind('leaflet.map', function(e, map, lMap) {

//it fires first, so is unable to get user_name data
alert('leaflet')

console.info(user_name)
})

If I do...

(function($) {

 Drupal.behaviors.fewo_map= {

 attach: function (context, settings) {

  $(document).bind('leaflet.map', function(e, map, lMap) {
    alert('leaflet')

    console.info(user_name)
    })
  }
 }
})

the result is the same

Also tried using JS injector, no success neither. I need the user_name as parameter to define the settings inside leaflet 'function'
Thanks


texts:
I've got a view with an exposed search terms filter. Within general search settings, the "minimum word length to index" is set to 3. The problem is that any multiple-word search with a single word that is less than the minimum invalidates the entire search. For example, I can search for "term1 term2" and get results as expected. If I search for "term1 term2 to", I get nothing (these results include the word "to", but that word is less than the minimum).

I realize I can adjust the "minimum word length to index" setting, but in this case, it seems preferable to ignore any words less than the minimum when I have a multiple-word search. Is there any way to accomplish this?

My searches have really only turned up issues with multiple terms not working at all, like this one, or other closed issues.

FYI, I'm using Views 3.14.


texts: How do I download a form table in CSV or Excel format?

texts:
I have a form whose class extends FormBase. The form has a table that gets populated with information.
Basically I'm trying to download the table into a CSV or Excel file. I've seen some old posts for Drupal 6 but I haven't found anything for Drupal 8.
How can I achieve this?


texts: Filter condition for entity reference field

texts: I am trying to create filter condition for  entity reference field added, but i am unable see the data when i give input in created filter condition text, i am trying from long ago searching in all possible way but dint got the reason please let me know what could be the issue,i will be very thankful.


texts: Is a MySQL statement from an external script possible?

texts:
I'm working with a PM on a Drupal project, and we're having little success finding a developer to answer (what we believe to be) a simple question.  I'm afraid I have no Drupal experience to speak of.

We've made well aware that Drupal itself doesn't use MySQL statements per se, but it is MySQL based, so - is it possible to write a SQL statement to find all users that have purchased a particular product/sku?  The SQL is to be used in an external script, outside of the website itself.

The developer is vague, at best, so I can't be any more specific than the fact that it's Drupal 7 using a standard ecommerce package.  I absolutely hate asking a broad question like this, but we're locked into this particular resource, and is insisting it will take 100+ hours to get this data to us, and I am unable to get to the DB to even try to construct the SQL.

Any advice is appreciated!  (and if you want some contract work, I'd be MORE than happy to talk).

Clarification

Again, I know this is vague, and the SQL itself would be a bonus in the answer.  The challenge is that the developer insists that Drupal doesn't use SQL statements, and therefore an external script isn't possible because it will take 100 hours to write a Drupal module to get that the result of the query.  I'm imagining something like this to determine if/when a customer last ordered product #1234.:

SELECT MAX(o.orderdate)
FROM users AS u
JOIN orders AS o on o.userid = u.userid
JOIN orderitems AS i on i.orderid = o.orderid
JOIN products AS p on o.productid = i.productid
WHERE u.email = 'somecustomer@example.com' AND o.productid=1234

With my limited Drupal experience, I know that this example isn't close to correct, but in principal, this is what we need to execute on a different server, with different software to simply get a date or a null.  If she'd give us credentials to look at the database, I could probably figure it out, but her "position" in the matter is that it can only be done with this exhaustive module development effort that she seems to want to do.


texts: Pathauto like pattern setting for creating menu link titles

texts:
Pathauto is great, in that it allows you to set the URL alias of a node to some pattern like '[node:menu-link:parent:url:path]/[node:title]-DEV' for DEV content type.

I am trying to build a single menu containing menu links for two content types. There is typically a node titled: nodecontent for each content type, then with pathauto we set the URL for the DEV content to be nodecontent-DEV by using the above pattern. It allows us to append a string, which is great.

I cannot figure out how to do this dynamically for menu links though. Since the only automatic action Drupal does is fill in the title for 'Menu link title'.

It would be great if I could append -DEV to each menu link (for that content type), so in one menu I could have:
Country>State>City and Country>State>City-DEV.


texts: How to use field variables in un-formatted view template?

texts:
If found this, but I can't manage to apply it to my case. Here goes. (I'm new to PHP coding and Drupal.)

I want to add a HTML link into each row of my unformatted views template. For each row I want the link for the relevant piece of content.

I used the devel dpm to reveal the variables in the unformatted.tpl.php. But I can't find a variable for the link field. (I've added the Content: Link field in views and it's hidden.)

My understanding at the moment is I'll need to set the variable in the relevant preprocess function, which might look like this:

 function mytheme_preprocess_views_view_unformatted(&$variables) {
    $link = Location of link field variable
}

And then use it in the views template:

<?php if (!empty($title)): ?>

<?php print $title; ?>

<?php endif; ?>
<?php foreach ($rows as $id => $row): ?>
  <div<?php if ($classes_array[$id]) { print ' class="' . $classes_array[$id] .'"';  } ?>>
    <?php print $row; ?>
    <?php print $link; ?>

<?php endforeach; ?>

But I can't find the link information and I can't find similar examples so I've probably gone badly wrong. How would I do that and is my basic understanding ok?


texts: Field collection views - How to make a reverse relaionship?

texts:
I am having difficulty finding the way to grab data from a referencing node.

CONTENT TYPES AND FIELDS

Content type "Referenced"
Content type "Referencing" with a field collection with these fields:

"Referenced item" - An Entity reference field to the "Referenced" content type.
"Note" - A simple text field

VIEWS

A view of type "Field collection item" - this is the view to be
embedded.
A view of a regular type ("Node") with a field to use the
inner view (Formatter: "View field-collection items") - this is the
embedding view. This view has a contextual filter of nid in order to
print it in Content type A.

NEED

In a view of type "Field collection item" - how do I fetch the data of the content type "Referencing"? Here are the fields needed:

Title
Note
Path

I have tried probably everything except the way it should work... Any help will be appreciated.

Thanks!


texts: Import data into Select List using using Feeds and the Feeds XML Parser from xml file

texts:
I have to import some data from a xml document.

I'm usuing the https://www.drupal.org/project/feeds and the https://www.drupal.org/project/feeds_xpathparser modules.

I have other fields which get the data with no problem at all. But I can't get a Select list to get the data from the xml.

XML LOOKS LIKE

<properties>
  <property>
    <type>House</type>
  </property>

  <property>
    <type>Flat</type>
  </property>

  <property>
    <type>Parking</type>
  </property>
</properties>

INFO OF THE field "Type" WHICH GET THE DATA:

Type:

List (text)

Control:

Selection List

Allowed values list:

House|House
Flat|Flat
Parking|Parking

THEN, IN THE FEED IMPORT SETTINGS:

-MAPPING: add the xpathparser selecting the field "Type"
-XPHATH XML PARSER - Settings: set the XPath for the field to "Type"

As far as I see everything is all right, but it doesn't work.

I have other fields in the same importer which get the data with no problem at all.


texts:
in my site I have update DS to the last versione 7.x-2.7 and now theme-hook_suggestions does not works. Drupal is update to the last version, too.

I, via mytheme_preprocess_node() function, insert some hook_suggestions for my node, based on node type and a field value.

Via devel themer I can see this:

Candidate template files:
ds-1col--node-article-full.tpl.php < ds-1col--node-article.tpl.php < ds-1col--node-full.tpl.php < ds-1col--node.tpl.php < ds-1col.tpl.php

theme_hook_suggestions (Array, 9 elements)
0 (String, 13 characters ) node__article
1 (String, 11 characters ) node__59325
2 (String, 31 characters ) ds_1col__node_article_cartoline
3 (String, 31 characters ) ds_1col__node_article_cartoline
4 (String, 7 characters ) ds_1col
5 (String, 13 characters ) ds_1col__node
6 (String, 18 characters ) ds_1col__node_full
7 (String, 21 characters ) ds_1col__node_article
8 (String, 26 characters ) ds_1col__node_article_full

Note that element nr 2 is my suggestion, so my function is correct.
(items 2 and 3 are identical because I have tried to insert the same template function code in a module function code to see if there was some type of problem with my templates).

Why my file (ds_1col__node_article_cartoline -> ds-1col--node-article-cartoline.tpl.php) in my "templates" directory in my theme is not used ? If I write a simple ds-1col.tpl.php in my "templates" directory file this file is used.

I have tried to change one of my module "weight" from 0 to 2 or from 0 to -1 (ds weight is 1) but without luck.

Where is the problem ?

Thanks.


texts:
Is it possible to redirect users from a controller?

I tried using the following code, but it doesn't work.

public function hello() {
  $query = $db->select('coop.oad','x');
  $query->fields('x', ['oad_url']);
  $query->condition('x.oad_soc', $column_name,'=');
  $result = $query->execute()->fetchField();

  return new TrustedRedirectResponse($result);
}


texts: Add div after each field of a certain name

texts:
I'm trying to display a div container after each field item with the name additional_content of my page content type. Right now im trying to preprocess my field but i can't go down to the real field item i want to proprocess...

Is it better to override the template? And how would that work? i have a field called additional_content integrated into my page content type. After this has been printed i want to add a div container to each of this items.

Any help with that?


texts:
I installed DrupalGap. Everything works fine so far, except that the node body is not displayed. I have none of the mentioned interfering modules installed. I also tried with a fresh Drupal 7 installation in a new test environment with the same result.

I ask for advice or hints.

Note: values are handed over. I can display the body instead of the title. But after clicking a node title, in the sub sequent page only the titel and the comments are shown.

Additional information: the edit mode of a node shows the html content. Only the view does not show the content (body)

10th of Jan 2020: I made a clean Drupal 7.69 installation with minimum modules (in order to exclude module interferences) with DrupalGap 7.x-1.17 on my localhost. Same effect - not showing the node body in View mode. I wonder what configuration the DrupalGap demo does have? There it works.


texts:
I know this question may get the dafs-adrenalin of some of you viewers going. But I'm just recently getting my head in there with php and drupal and have been searching the api and googled a possible function only to find functions that did all sorts of other stuff.

It's that I have this custom logic where I want to change the language object after I've set a $_COOKIE['lang']. The value of the cookie lang would be a language code like en or fr. And going $language->language -> $_COOKIE['lang']; is pretty rediculous.

So the question maybe then is: I Know the value of $language->language, now I want to use the function that Drupal uses in core to construct the entire language object. This way the language object actually changes after the cookies is set and the locale module can to it's work to load the site in the new language?


texts: How to get the hard coded string as output in views_php module

texts:
I am using quiz module.

I am creating a view which has field which shows the status of the quiz. If the user score is greater than pass rate, the field should display "pass" else "fail". How to achieve this.

I used views php module to do this. But, I'm confused between Value code and Output code.

Can anybody provide some pointers?


texts: Best way to get best breadcrumbs for Commerce

texts:
When a user is checking the product page, the breadcrumb trail should give Home > Shop > Category > Product aka Home > Shop > Hats > A Hat

I used Crumbs, but it only gives me Home > Hats > A Hat and I cannot figure out how to include > Shop >.

Well obviously at the same time the breadcrumbs should also work fine in the rest of the pages like for contacts page it would be Home > Contacts

What would you recommend? What module? Or is it still possible with Crumbs and I am missing something?


texts:
I have Organic Groups installed within Drupal 7 and I am attempting to get the groups to display in the menu. For all authenticated users I want the group(s) they belong to show up in the menu (could be the user menu).

Addition:

The picture below shows how far I have gotten. This is within the edit view window. The closest window shoes the fields that can be added. The only group-specific fields I found are Group: Group permissions and Group: Group user roles and for the filter there aren't any group-specific choices. Is there some roundabout way to add them or a specific permission I may be missing. I have given my administrator (currently logged in) all of the permissions listed for the groups.


texts: Meaning and Purpose of Global:NULL in views contextual filters

texts: I have been researching using of multiple parameters in a view used as contextual filters like category/1/10/15/11 etc, if all the parameters are present, it works fine, but what if some parameter isnt there in certain sitautions?how to go about this? What I have seen around is Global Null used here and there , but i just cant get a grasp of it, What is actual purpose of GLOBAL NULL?


texts: How I show theme selection page with thumbnails to everyone?

texts: I want to create a menu link for theme selection to users (also for anonymous users). I have installed the Switchtheme module but it shows only theme names; my requirements are to show the theme name with thumbnails, just like we see in "User account -> edit -> theme configuration" or with normal theme selection in admin/build/themes. So how can I do this?


texts: Where do I add this property to made plupload start the upload automatically

texts:
I found a great solution to upload images automatically, but I need help understanding where the code goes and how I figure out what the "my_element" value should be.

This is a follow-up question to an existing question but I do not have permission to comment on existing questions :/
How can I make Plupload in D7 start uploading automatically?

The code:
$form['my_element'] = array(
  '#type' => 'plupload',
  '#title' => t('Upload files'),
  '#description' => t('This multi-upload widget uses Plupload library.'),
  '#autoupload' => TRUE,
);

Do I put this within the plupload.module or filefield_sources_plupload.module?
The machine name of my image field is field_image, so is that what I use in place of "my_element"?


texts: Setting upper limit on user profile picture

texts:
I am not finding any option to set upper limit on user profile picture. Currently user can upload file of any size. I want to prevent this scenario and allow user to upload his picture of maximum 2Mb  or other.

How can set upper limit on profile picture?


texts: Customize Login Widget (set Default values in login input fileds)

texts:
I added the login widget block to a page

I want to set the default value text "username" and "password" to the input fields.

It currently looks like 1. I want it to look like 2


texts: Drush alias - @alias status could not be found

texts:
Problem

I'm trying to create a drush alias following the excellent example posted here.

EXAMPLE:

$aliases['dev'] = array(
   'root' => '/path/to/drupal',
   'uri' => 'dev.mydrupalsite.com',
 );

MINE:

<?php
$aliases['main'] = array(
    'root' => '/srv/www/mysite/public',
    'uri' => 'main.mysite.net',
  );
?>

According to the example the following two commands are equivalent:

 $ drush @dev status
 $ drush --root=/path/to/drupal --uri=dev.mydrupalsite.com status

And if I run:

$ drush --root=/srv/www/mysite/public --uri=main.mysite.net status

I get a full report. But if I run

 $ drush @main status

I get the error @main status could not be found.

The alias file has been discovered, running drush status in the drupal root shows it has been found. It's ~/.drush/mysite.net.alias.drushrc.php. What have I done wrong?


texts: How to let users choose to hide fields in their profile?

texts:
Is there a way to allow users to choose to hide certain fields in their profile?

For example if building a job site, a user might choose to hide their name from others. Is there a way to do this?


texts: Content type creation with table of fields

texts:
I want to be able to create a content type with a number of fields (naturally). One section of the content type needs to be like the attached image with the ability to:
 - group items together (e.g. an 'ingredient' in a recipe' - "2 cups flour, sifted"
 - link (via autocomplete) to existing nodes [INGREDIENT NAME field below]
 - add multiple items with a "more" button

Below is a screenshot from the 'Recipe' module. Is it possible to create this structure with CCK and can this be then added in a feature?


texts: How to find the name of changed file in Forms API

texts:
I've a file field attached to a node form. I want to know in the submit handler if the file has been replaced then I'll take some action.

For example I delete the previously uploaded file : abc.txt and then upload a new one "newdoc.txt" in place of it and "Submit".

I don't want to  load the node and read it's contents or use hook_presave and read the value using $node->original.


texts: Invoking AJAX on a form messes up my form_alter function

texts:
I am altering the "Add node" form for one of my types so that I can set the title and disable the text box. The (shortened) code looks like this:

function mytheme_form_node_form_alter(&$form)
{
    $form['title']['#default_value'] = 'Some value';
    $form['title']['#disabled'] = true;
}

On the node form, I have a field with "Unlimited values" where a user can click "Add another item" to add another row to the items grid on the form.

The problem: When I click this button and the AJAX request happens, it adds the row to the table as usual. But when I save the form, Drupal thinks the Title is empty, and throws a validation error back. The title is still set and greyed out after the AJAX request happens (like it should be), but it seems to "unset" itself somehow behind the scenes when the AJAX request happens, because when the form gets saved, the title gets cleared and the validation error occurs.

I hope I made that clear... so does anyone know why the AJAX related to unlimited fields might interfere with theme_form_X_form_alter?


texts: How and where to add google analytics tracking code?

texts:
Creating a single page responsive site in drupal 7.While trying to enable google analytics module,came through certain doubts. While registering our site with google analytics they gave us a tracking id (a js snippet)
Can anyone tell me after enabling module is it necessary to add the snippet ?
If its necessary ,then where to add the snippet in which .tpl file in drupal?


texts: What is the Context column for in String Overrides module?

texts:
With Drupal 7 I have the String Overrides module and there's a coulmn called "Context." I was wondering what this is for?

I was thinking maybe I could type in something like 'user/' and the string replacement would occur only on 'user/' pages?


texts: D6 Insert module with CKeditor does not work with styles

texts:
Summary

Using Imagefield and  the Insert modules, I can insert into CKeditor "Automatic" image styles, but not "Lightbox" styles.

What I've tried

This suggests that CKeditor is filtering the inserted code. I've tried disabling (a)  Security>Security filters "HTML filter" (b) Advanced content filter (c) Advanced options>Custom JavaScript configuration "config.allowedContent = true;"

How to

I've added an imagefield to my content type. In Create node, I upload an image, and a Style box appears with "Automatic" and pre-defined imagecache options. If I select Automatic and click  the Insert button, my image appears in CKeditor. If I select one of the imagecache/lightbox options and click Insert, nothing happens.

Set-up

I'm running: Drupal 6.35, CKeditor 1.15 (with CK editor 4.3.4), Insert 1.2, ImageField 3.11, imagecache 2.0-rc1, Lightbox 1.11.

Any suggestions?