Git Product home page Git Product logo

lever-craft-plugin's Introduction

Lever

Lever Craft CMS 4 Plugin

Get Lever job details and post applications directly from Craft.

Scrutinizer status


Installation & Setup

  • composer require workingconcept/craft-lever
  • php craft install lever or install from Settings โ†’ Plugins in the control panel
  • add your site and API details in the control panel via Settings โ†’ Lever

Development

Templating

craft.lever.jobs([])

Returns an array of jobs. Supply valid parameters for the job postings API if you need to tailor the results.

craft.lever.job(id)

Returns a specific job matching the provided Lever ID, or false.

Job Properties

  • id
  • text
  • categories
  • country
  • description
  • descriptionPlain
  • lists
  • additional
  • additionalPlain
  • hostedUrl
  • applyUrl
  • createdAt
  • workplaceType

Template Examples

List Jobs

{% set positions = craft.lever.jobs %}

<h2>Work with Us!</h2>

<ul>
{% for position in positions %}
    <li><a href="{{ position.hostedUrl }}" target="_blank">{{ position.text }}</a></li>
{% endfor %}
</ul>

Custom Job Application Form

You can create your own form and validation and submit it with an action field set to lever/apply. Use any fields named exactly as seen in the postings API, with jobId, name, and email being required.

<h3>Apply</h3>

{% if application is defined and application.getErrors() | length %}
    {% for field in application.getErrors() %}
        {% for error in field %}
            <p class="error" role="alert">{{ error }}</p>
        {% endfor %}
    {% endfor %}
{% endif %}

<form id="job" action="" method="post" accept-charset="UTF-8" enctype="multipart/form-data">
    {{ csrfInput() }}
    {{ redirectInput(craft.app.request.absoluteUrl ~ "?success=y") }}
    <input type="hidden" name="action" value="lever/apply">
    <input type="hidden" name="jobId" value="{{ job.id }}">

    <input type="text" name="name" value="{{ application.name ?? '' }}" required>
    <input type="email" name="email" value="{{ application.email ?? '' }}" required>
    <textarea name="comments">{{ application.comments ?? '' }}</textarea>

    <input type="file" name="resume" required>

    <button class="btn">Submit</button>
</form>

Establishing Custom Job Detail Pages

You can display all job details on your site if you'd like, including custom detail pages. One way you might go about that is to create a detail page template like jobs/_detail.twig and set up a custom route for it.

Barebones template:

{% extends "_layout" %}

{% set job = craft.lever.job(id) %}

{% if job is empty %}
    {% exit 404 %}
{% endif %}

{% block content %}

...

Custom route in config/routes.php:

return [
    'jobs/<id>' => ['template' => 'jobs/_detail'],
];

This will take requests like https://site.foo/jobs/be9f3647-b59a-4272-94a0-8b937520a69f and send them to your template, where they'll 404 if the ID is invalid.

Events

EVENT_BEFORE_VALIDATE_APPLICATION

Triggered after an application is submitted and before it's validated. You can adjust $event->application if you need to do something custom like handle a FilePond upload and attach it to the LeverJobApplication model.

EVENT_BEFORE_SEND_APPLICATION

Triggered after an application is submitted and before it's sent to Lever. Grab the application data from $event->application and prevent it from being sent by setting $event->isSpam to true.

EVENT_AFTER_SEND_APPLICATION

Triggered immediately after an application is sent to Lever successfully. Same $event->application and $event->isSpam properties available.

Support

Please submit an issue or a pull request if anything needs attention. We'll do our best to respond promptly.


This plugin is brought to you by Working Concept, which has no affiliation with Lever.

lever-craft-plugin's People

Contributors

mattstein avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

lever-craft-plugin's Issues

Craft 4 support?

Will there be (official) support for Craft 4?

I haven't tested it in Craft 4 personally yet, but as the plugins we use start to have support for v4, we will upgrade. It'd be nice if the Lever plugin kept up.

PHP 8 Support

My web host recently upgraded to PHP 8.1 and I am unable to update/install version 1.0.4.

Steps to reproduce:

composer install

Problem 1
- workingconcept/craft-lever is locked to version 1.0.3 and an update of this package was not requested.
- workingconcept/craft-lever 1.0.3 requires php ^7.0.0 -> your php version (8.1.10) does not satisfy that requirement.

Potential Fix

Update PHP requirement in composer.json with:
"php": "^7.2.5|^8.1",

No plugin exists with the handle "lever"

Hello, thanks for the plugin! I've successfully installed it locally and it made life a lot easier.

The problem is when I attempt to restart my local instance. I'm using Docker and when I try to bring it up I get the following message in my terminal logs:

CraftCMS    | Migrated up successfully.
CraftCMS    | Installing plugin "lever" ... error: No plugin exists with the handle "lever".
CraftCMS    | Aborting config sync
CraftCMS    | Yii Migration Tool (based on Yii v2.0.16)
CraftCMS    |

This just continues to loop and doesn't start. Any ideas what the issue could be here?

Abandoned? Or just taking a rest...

Is this plugin still supported? The reason I ask is it's marked as abandoned in the Craft Plugin Store, yet the recently added support for Craft 4 implies it just might have a future?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.