Webflow Integration

Integrate Greenhouse Job Listing in Webflow

Add Greenhouse to your Webflow site to improve application experience.

Webflow Job Board Example:

JOBS

Job Openings

Development
Heading
This is some text inside of a div block.
View Position

How to integrate Greenhouse Job Board in Webflow

Step 1

Copy the component or duplicate the project. 

Make sure the attributes added remain to make sure the code works.

Greenhouse Job Board Template Webflow
Step 2

Add the code below

This code adds the jobs and departments for the jobs to you want to showcase.

class GREENHOUSEJOBBOARD {
    constructor() {
        this.tableBody = document.querySelector("[data-item='table']");
        this.jobItem = this.tableBody ? this.tableBody.querySelector("[data-item='job-item']") : null;
        this.tableParent = this.tableBody.parentElement;

        this.jobs = null;

        this.init();
    }
    init() {
        this.loadJobsFromApi();
    }

    loadJobsFromApi() {
        let url = 'https://boards-api.greenhouse.io/v1/boards/webflow/departments';
        fetch(url)
            .then((res) => {
                if (res.ok) {
                    return res.json();
                }
            })
            .then((data) => {
                this.jobs = data.departments;
                this.appendJobs(this.jobs);
            })
            .catch((err) => console.log(err));
    }

    appendJobs(jobs) {
        if (this.tableBody != undefined && this.jobItem != undefined) {
            if (jobs.length > 0) {
                jobs.forEach(job => {
                    if (job.jobs.length > 0) {
                        let newTable = this.tableBody.cloneNode(true),
                            department = newTable ? newTable.querySelector("[data-item='department']") : null;
                        if (department != null) {
                            department.innerHTML = job.name;
                        }
                        job.jobs.forEach(data => {
                            let newJob = this.jobItem.cloneNode(true),
                                roleText = newJob ? newJob.querySelector("[data-item='role-text']") : null,
                                location = newJob ? newJob.querySelector("[data-item='location']") : null,
                                apply = newJob ? newJob.querySelector("[data-item='apply']") : null;

                            if (roleText != null) {
                                roleText.innerHTML = data.title;
                            }
                            if(location != null){
                                location.innerHTML = data.location.name;
                            }
                            if(apply != null){
                                apply.setAttribute("href", data.absolute_url)
                            }
                            
                            newTable.querySelector("[data-item='job-item']").parentElement.appendChild(newJob);

                        });

                        this.tableParent.appendChild(newTable)

                        newTable.querySelectorAll("[data-item='job-item']")[0].remove();
                    }
                });

                this.tableBody.remove()
            }
        }
    }
}

new GREENHOUSEJOBBOARD;
Copy code
Step 3

Update the greenhouse URL 

Adding your job-board to the code to pull the data.

Greenhouse Job Board Webflow Custom Code
Step 4

Hit publish, and it should be working.

Looking to create a CMS template page in Webflow for each job?

Reach out to us and we’ll set up the required options provided by Greenhouse:

https://support.greenhouse.io/hc/en-us/articles/200721644-Choose-a-careers-page-integration-option
Setup a free consultation
Made by Little Big Things