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

How to include taxonomy entity reference in product twig?

Hi

I have a product type called phyical product

I have created a taxonomy called product brand

in product--physical.html.twig I have {{ product.body }} {{ product.variations }}, etc. which render.

I try to load the taxonomy

{% for item in product.product_brand %}

{% set title = item.entity.label %}
  <div class="title-wrap">{{ title }}</div>

{% endfor %}

It doesnt work.

Have tried other variations.

[SOLVED]Translatable configuration

Hi everyone, i have a question, lets suppose that i have a module with a config form that writes a message on my settings, this message is customizable by the user, but i need to make this customized text to be translatable, what is the right way to do it? i did it by placing a t() during save:

Form State save in DB to load later

Hello Everyone,

In D7, I was able to save a form's state as a blob, and then load it again when needed.

Has anyone done something similar in D9?

Thanks,

Nick

Build a mini calendar in sidebar

Hey guys, 

I'm a newbie to drupal 7.

How do you build a mini-calendar in the sidebar? I have installed the calendar module. 

I appreciate a tutorial process, Thanks!

Class does not exist in ReflectionClass->__construct()

Problem that I didn't manage to fix

I got this error after I did the following:

  • Made a custom module in which I implemented a class that would subscribe to an event with a method

    • couldn't find out how to find the name of the event I was supposed to subscribe to in the return statement (you know, something like ConfigEvents::SAVE or something) so I gave up on this

Node or Entity

I need to build a data-centric module which will have about 100 fields and over 100,000 records, for logged in users' viewing only.

I can save all fields in one DB (i.e. as an entity) or have each field has it's own table (i.e. make it a node).

Which approach would be more practical (I am inclining towards single DB table). Has someone done any speed analysis on a similar scenario?

Thanks,

Nick

Pages

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