Job Board: How to get a link to specific vacancy

By default, the Job Board widget doesn’t provide a way to create direct links to individual job listings.

Good news — our devs created a custom solution that adds the job title to the URL, so you can share direct links to specific vacancies :sparkles:


How to set it up


Open the Settings tab in your widget editor and paste the following code into the Custom JS field:

const JOB_PARAM = 'job';

const searchParams = new URLSearchParams(window.location.search);
const currentJob = searchParams.get(JOB_PARAM);

const checkPopup = () => {
  const popup = util.findElement('[class*="PopupComponent__Card-sc"]');
  if (!popup) {
    const url = new URL(window.location.href);
    url.searchParams.delete(JOB_PARAM);
    history.pushState({}, '', url);

    document.removeEventListener('click', checkPopup);
  }
};

const getJobTitle = (job) =>
  job.querySelector('[class*="TitleBlock__Title-sc"]')?.textContent.trim();

if (currentJob) {
  const jobTitle = decodeURIComponent(currentJob);
  util.waitForAllElements('[class*="Item__Card-sc"]').then((cards) => {
    const jobCard = [...cards].find((c) => getJobTitle(c) === jobTitle);
    if (!jobCard) return;

    jobCard.click();
  });
}

util.addListener('[class*="Item__Card-sc"]', 'click', (e) => {
  const title = getJobTitle(e.target);
  if (!title) return;

  setTimeout(() => {
    const popup = util.findElement('[class*="PopupComponent__Card-sc"]');
    if (!popup) return;

    const url = new URL(window.location.href);
    url.searchParams.set(JOB_PARAM, title);
    history.pushState({}, '', url);

    document.addEventListener('click', checkPopup);
  });
});

After adding the code, opening a vacancy will automatically update the URL with the job title. You can copy this link and share it — users who follow it will be taken directly to the same job listing :raising_hands:


Heads-up: Custom JS isn’t available in preview mode. To check if everything works correctly, test the widget on your published website or use the Share Link.

Try it out and feel free to share your feedback with us :slightly_smiling_face:

2 Likes