CMS Development

milos_peric
Miembro | Partner nivel Platinum
Miembro | Partner nivel Platinum

Accessing modules field value

Hello, 

So we have a coded hubl template. Every module is mostly wrapped in dnd_section block. We have trouble accessing one of the values of the custom module rich text field. When i try to put export_to_template_context=True next to dnd_module section it renders nothing and i simply can't access the "content" field of the - module_attribute "col_1" - section. In the picture below you can see the field we want to access  ("content"). So, my questions is, how would i access that field and am i missing something since we tried a lot of different approaches?

milos_peric_0-1613377038166.png

 

  

0 Me gusta
2 Respuestas 2
milos_peric
Miembro | Partner nivel Platinum
Miembro | Partner nivel Platinum

Accessing modules field value

The idea was to let the content editor edit a given rich text field and to put the 'content' value of that rich text into a json integrated into the template (schema for job postings).
That way, content editor wouldn't have to care about given json and by entering  the job description for example as he would normally do, that job description would automatically be inserted into the json file in appropriate field.
So basically, user enters a job description in rich text ->  job description automatically updates json "job_description" field and he gets a google optimized job posting page without having to worry about the schema.

Kevin-C
Experto reconocido | Partner
Experto reconocido | Partner

Accessing modules field value

Hey @milos_peric 

 

I did a little testing, and though not entirely exhaustive I was unable to have a DND module export to template context as well.

 

What's your use case for this functionality? I'd be willing to bet we could find another solution.

Kevin Cornett - Sr. Solutions Architect @ BridgeRev