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

Layout Builder : clone page layout, reorder sections...

Hi,

I am developping a module which adds "advanced actions" to the new Drupal 8 Layout Builder.

For example, cloning a page layout into another, reordering sections inside a page layout, etc. For the moment i essentially use custom database queries in order to achieve this, and this is working quite well (despite the fact that this probably is not the correct way to do this).

How set Media library widget to display table-style as default?

Hi Drupal Community,

I spent couple of hours to find a way to set table-style as default display of Media library when the field widget modal is opening with 'File' as media-type, but no luck. It always opens with 'Grid' style.

Can anyone give me some advises how to do that? Should I use viewsview hook to override the Media Library view?

How add a background image visible in the header and body ??

Hi guys,

On my site I would like to add an image in the header and body of my homepage but once programmed I would like to be able to control the image via an image field in my "Homepage" content type and be able to change it without going through the code.
Currently, I'm just managing to add an image in the 
<div class="image-back>
</div>

image-back{ background :url(...)...}.

but it doesn't take into account the full width of the
I tried with the preprocess, moving the head block into bloc body...

How do I add 'beforesend' code to an ajax call

I have an ajax form which works well.  It uses the ajax below to make the submit button update the form:

          '#ajax'       =>
            [
            'callback' => '::ajax_callback',
            'wrapper'  => 'my-container',
            ],

How do I add 'beforesend' functionality to this definition if for example, I want to update the background color of the submit button before the ajax call is sent?

Thanks.

how to count the number o content when two entity reference are the same

Hi, I'm creating a module to create alerts about student absences I have 1 type of content called attendance that has

fields title, field_student (reference to content type student), field_subject (reference to type of content subject) and a field to know whether or not it was a list of integers I need to count how many absences each student has per subject and create another type of content that will be alert I appreciate any idea in advance

Call to undefined method stdClass::id() in TranslationLanguageRenderer -> preRender()

I'm getting "Error: Call to undefined method stdClass::id() in Drupal\views\Entity\Render\TranslationLanguageRenderer->preRender() (line 91 of core/modules/views/src/Entity/Render/TranslationLanguageRenderer.php)." whenever I go to admin/structure/taxonomy, edit the Department vocab, and then try to click on one of the terms.

If I click the edit button next to the term, it lets me make edits and save fine but whenever I try to click on the actual term or try to use the term id in a view, it gives me that error or completely breaks the view.

Pages

Subscribe with RSS Subscribe to RSS - Module Development and Code Questions