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

How to auto-create source field for Media type as 'Text (plain, long)'

I have created a sandbox module, Media Entity Remote Image to provide remote image integration for Drupal core Media. I'm using Drupal 8.6.1.

When creating a new Media type, if I select "Remote image" as the 'Media source', a 'MEDIA SOURCE CONFIGURATION' section appears where I select the source field:

MEDIA SOURCE CONFIGURATION

Style (set height and width) of image field being rendered with views php

The context: drupal 7, views, views PHP, rendering some fields with PHP because (good) reasons.

$nodo = node_load($row->nid);
$strmn = '<div class="post-block">';
$strmn .= '<div class="post-image">';
$image = field_get_items('node', $nodo, 'field_image');
$preout= field_view_value('node', $nodo, 'field_image', $image[0]);
$linko= url('node/'. $nodo->nid);
$strmn .= '<a href="' . $linko . '">' . render($preout) . '</a>';

After a lot of googling I've been able to write this.

My attached JavaScript is not working when I paged the table

Hi!

I have some checkboxes in a table (With many pages) my aim is to prevent users to select more than one choice.

I attached a JS code, It's working when I open the table in the first page but not working when I paged in the table(Page 1, 2, 3 ...).

I am wondering what event is triggered when I paged the table because the html page is not reloading.

Best!

https://ibb.co/bwnO7K

Submit button hidden behind video preview

I am having issues right now with selecting videos to add to my pages. Right now when you upload and select a new video in the Media Browser Module the Submit button is hidden behind the video's preview, screenshot. I am not sure what is causing this issue.

I have tested with the videos that have previously been uploaded and the button seems to display totally fine, screenshot.

Any help with this issue would be gratefully appreciated.

Access node object from page being viewed

Hello,

I have a custom module with a form item like so:

		$form['button'] = array(
			'#type' => 'submit',
			'#value' => t('Test PHP'),
			'#submit' => array('mymodule_form_action'),
		);

In my custom function I have:

looping through unlimited resource entities

I'm a newbie to drupal and i'm struggling to understand entity references.

i'm try to return an array with just the data required for the output from my custom mudule controller.

i have a field in my product content type of unlimited entity reference

the outer foreach works fine but how do i loop through the unlimited entity reference

Pages

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