CMS Development

alyssaomara
Contributor | Partner
Contributor | Partner

Need some help with m a client's blog post template

Hi,

 

I'm hoping someone can help. I am trying to add a module within my blog post template. I think I somehow need to add it within the Blog Content module, but i'm not sure how. Adding rich text modules below my blog content module does not work. I often will add an image to my blog post with text to the side, or rather I would like to. However, using an image align does not look good on mobile. Any ideas on how I can accomplish this?

 

My template is here: https://app.hubspot.com/content/2086007/template-builder/templates/4511985900

 

Thanks very much in advance!

0 Upvotes
1 Reply 1
Ty
HubSpot Employee
HubSpot Employee

Need some help with m a client's blog post template

Hi Alyssaomara,

 

Correct me if I'm wrong, but it sounds like you just want to add another module into your Blog's post template. Because of this Adding a module using the drag nd drop editor doesn't work because it's too far down, correct?

Or are you trying to add a module to your Listing template? I included a solution for both, just in case.

 

Adding A Custom Module To Your Blog Content Post View

At the top of your template, using HubL, create a new module for whichever one you want, ie: textarea, richtext, etc..

{% textarea "your_textarea" label='Additional Plain Text Block', value='Your Default Textarea Value', export_to_template_context=True %}

and then to display your new text area, enter this at the end of your post in the Blog Content Module

<div class="additional-textarea">{{ widget_data.your_textarea.value }}</div>

  

If You Want This Displayed On Your Listing Page

Then use the same module from above, except when it comes time to print it, you will place this in your Blog Listing template

<div class="additional-textarea">{{ content.widgets.your_textarea.body.value }}</div>

It's important to note the content.widgets and body.value when calling a module from POST to LISTING.

 

You can learn more about HubL from our designer docs, found here.

 

Please let me know if this is what you were looking for, hope this helps!

-- Ty