CMS Development

DM2
Member

Using a custom module field for blog post in the listing template

SOLVE

Hi

 

I have a created a custom module on the blog post template that has a boolean field named 'darken_listing_image'. 

 

I want to bring this variable in to my listing template so I can apply some conditional styling. I've tried this within my content loop but it doesn't seem to be working:

 

{{ content.widgets.module_151618187561037.body.darken_listing_image.value }} 

the module ID obviously relates correctly. Can anyone point me in the right direction please?

 

Thanks

 

 

0 Upvotes
1 Accepted solution
DM2
Solution
Member

Using a custom module field for blog post in the listing template

SOLVE

Pleased to say this worked (removed ".value" from the end):

 

{{ content.widgets.module_151618187561037.body.darken_listing_image }} 

 

View solution in original post

3 Replies 3
DM2
Solution
Member

Using a custom module field for blog post in the listing template

SOLVE

Pleased to say this worked (removed ".value" from the end):

 

{{ content.widgets.module_151618187561037.body.darken_listing_image }} 

 

psdtohubspot
Key Advisor

Using a custom module field for blog post in the listing template

SOLVE

Hi @DM2 

I am Bit confused with 
boolean field named 'darken_listing_image'.

{{ content.widgets.module_151618187561037.body.darken_listing_image.value }} 


Please confirm it's Boolean or image field, it seems you want to show the additional image on Blog Listing Post Items? 

Please let me know the scope in Brief.

Thanks!

0 Upvotes
DM2
Member

Using a custom module field for blog post in the listing template

SOLVE

Hi @psdtohubspot 

 

Yes it's a boolean field that alters the way the feature image is displayed in the blog listing page - if true there is a darken filter added.

 

At the moment I'm just trying to get it to display 'true' in the listing.

 

{{ content.widgets.module_151618187561037.body.darken_listing_image.value }} 

 

Once I can see that I'll use an if statement to apply the class.

 

Thanks for any help.

0 Upvotes