简体   繁体   中英

Custom background in Hubspot template

I am building a template in Hubspot. I want to make a background image editable from the front end. I have seen this in a template but I am unable to find the option from the hubl reference.

Go in content -> Design manager in left page find "Custom Modules", click this. At the top right you can find the button "New custom module". click this. In popup click "Custom modules" and "create". Bottom left click on "Add new field" and "image", Fill this.

you'll find something like:

{{ widget.field_name.src }}

You could change it to:

<style>
    #[your-element-id] {
        background: url({{ widget.field_name.src }});
    }
</style>

Now you have the form, you just need to add in the template.

<element selector> {
    background-image: url({{ widget.field_name.src }});
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM