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

Get translated field label programmatically

I am developing a custom module for a multilingual Drupal 8.7.x website. I need to get the label of a field attached to a node which has several translations. I cannot find a way to get the translated label of this field from my module's code.

The field label is translated by using the Translate Content Fields action, the one at /admin/structure/types/manage/{content type name}/fields/{field name}/translate. The translated label displays as expected on the node add/edit form and on the node page.

Specified key was too long; max key length is 767 bytes

Hello everybody, 

i converted the DB from utf8 to utf8mb4 in my local server and i imported the DB to my hosting (godaddy hosting) i got this message: Specified key was too long; max key length is 767 bytes

i can't access to my.cnf or my.ini files

is there any other solution ? maybe i need to edit something in the database !!!

D7 Module xxx_block_view hook

Hi !

I'm following D7 userguide to learn module development and don't understand the way data is formatted to pass it to the view.

instruction, taken from the guide without modification

$block['content'] = theme('item_list', array('items' => $items));

$items is build like this (in a foreach($result as $node) loop)

$items[] = array('data' => l($node->title, 'node/' . $node->sid),);

In this exemple, it manages only one field : title. What if I need to manage two or more field ?

How to Build a New Source for Drupal 8 feeds

Hi,

I'm trying to create an RSS feed from https://www.homesoverseas.ru/rss/news/.

I don't understand which SOURCE I should choose for Body:Text in field mappings.

Content => Body: Text  - doesn't work.

If I select "New sorce... " and new fiel "fulltext" - doesn't work.

All other fields (Title, Body:Summary, date) are imported correctly.

Please help to understand which SOURCE  to select for the field Body:Text?
 

anti-spam registration by asking the user to choose from photos

Hi. I'm setting up Drupal 8 for a community whose members have some common knowledge that the spammers don't have. I can, therefore, control spamming by asking the new users to choose the photo that is most relevant to the community as part of signing up.

How to get nearby zip codes of a particular zip code and radius using google map in Drupal 7?

How to get nearby zip codes of a particular zip code and radius using google map in Drupal 7? Zip code and radius fields are there in search form. After providing a particular zip code and radius(ex 5 mile), it will return some zip codes within the given radius. How google map api will process the particular zip code(12345) and given radius(5 miles) and return a set of nearby zip codes?

Pages

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