ProcessWire - Job Template: Unterschied zwischen den Versionen

Aus Wikizone
Wechseln zu: Navigation, Suche
 
(10 dazwischenliegende Versionen von 3 Benutzern werden nicht angezeigt)
Zeile 1: Zeile 1:
 +
== Links ==
 +
[[ProcessWire - Job Modul]]
 +
 
== Beispiel Setting für Jobs mit strukturierten Daten ==
 
== Beispiel Setting für Jobs mit strukturierten Daten ==
 
Beispiel von SPPS
 
Beispiel von SPPS
Zeile 526: Zeile 529:
 
</pre>
 
</pre>
  
Job Fieldset Page  
+
'''Job Fieldset Page'''
  
 
Das Feld fasst die anderen Felder in eines zusammen. So kann man sie einfacher handeln.
 
Das Feld fasst die anderen Felder in eines zusammen. So kann man sie einfacher handeln.
Zeile 598: Zeile 601:
 
</pre>
 
</pre>
  
 +
==== Templates Import ====
 +
Import Daten (Zulässige Kind/Elternseiten von Hand nachtragen)
 +
<pre>
 +
{
 +
    "job": {
 +
        "id": 53,
 +
        "name": "job",
 +
        "fieldgroups_id": "job",
 +
        "flags": 0,
 +
        "cache_time": 0,
 +
        "useRoles": 1,
 +
        "editRoles": [],
 +
        "addRoles": [],
 +
        "createRoles": [],
 +
        "rolesPermissions": [],
 +
        "noInherit": 0,
 +
        "childrenTemplatesID": 0,
 +
        "sortfield": "",
 +
        "noChildren": 1,
 +
        "noParents": "",
 +
        "childTemplates": [],
 +
        "parentTemplates": [
 +
            "jobs"
 +
        ],
 +
        "allowPageNum": 0,
 +
        "allowChangeUser": 0,
 +
        "redirectLogin": 0,
 +
        "urlSegments": 0,
 +
        "https": 0,
 +
        "slashUrls": 1,
 +
        "slashPageNum": 0,
 +
        "slashUrlSegments": 0,
 +
        "altFilename": "",
 +
        "guestSearchable": 0,
 +
        "pageClass": "",
 +
        "childNameFormat": "",
 +
        "pageLabelField": "fa-user-circle-o title",
 +
        "noGlobal": 0,
 +
        "noMove": 0,
 +
        "noTrash": 0,
 +
        "noSettings": 0,
 +
        "noChangeTemplate": 0,
 +
        "noShortcut": 0,
 +
        "noUnpublish": 0,
 +
        "noLang": 0,
 +
        "compile": 3,
 +
        "nameContentTab": 0,
 +
        "noCacheGetVars": "",
 +
        "noCachePostVars": "",
 +
        "useCacheForUsers": 0,
 +
        "cacheExpire": 0,
 +
        "cacheExpirePages": [],
 +
        "cacheExpireSelector": "",
 +
        "label": "Stellenangebot",
 +
        "tags": "",
 +
        "titleNames": 0,
 +
        "noPrependTemplateFile": 0,
 +
        "noAppendTemplateFile": 0,
 +
        "prependFile": "",
 +
        "appendFile": "",
 +
        "pagefileSecure": 0,
 +
        "tabContent": "",
 +
        "tabChildren": "",
 +
        "nameLabel": "",
 +
        "contentType": "",
 +
        "errorAction": 0,
 +
        "connectedFieldID": null,
 +
        "ns": "ProcessWire",
 +
        "_exportMode": true,
 +
        "roles": [
 +
            "guest"
 +
        ],
 +
        "fieldgroupFields": [
 +
            "title",
 +
            "layout_blocks",
 +
            "job"
 +
        ],
 +
        "fieldgroupContexts": {
 +
            "title": [],
 +
            "layout_blocks": [],
 +
            "job": []
 +
        }
 +
    },
 +
    "jobs": {
 +
        "id": 55,
 +
        "name": "jobs",
 +
        "fieldgroups_id": "jobs",
 +
        "flags": 0,
 +
        "cache_time": 0,
 +
        "useRoles": 1,
 +
        "editRoles": [],
 +
        "addRoles": [],
 +
        "createRoles": [],
 +
        "rolesPermissions": [],
 +
        "noInherit": 0,
 +
        "childrenTemplatesID": 0,
 +
        "sortfield": "",
 +
        "noChildren": "",
 +
        "noParents": -1,
 +
        "childTemplates": [
 +
            "job"
 +
        ],
 +
        "parentTemplates": [],
 +
        "allowPageNum": 1,
 +
        "allowChangeUser": 0,
 +
        "redirectLogin": 0,
 +
        "urlSegments": 0,
 +
        "https": 0,
 +
        "slashUrls": 1,
 +
        "slashPageNum": 0,
 +
        "slashUrlSegments": 0,
 +
        "altFilename": "",
 +
        "guestSearchable": 0,
 +
        "pageClass": "",
 +
        "childNameFormat": "",
 +
        "pageLabelField": "fa-users title",
 +
        "noGlobal": 0,
 +
        "noMove": 0,
 +
        "noTrash": 0,
 +
        "noSettings": 0,
 +
        "noChangeTemplate": 0,
 +
        "noShortcut": 0,
 +
        "noUnpublish": 0,
 +
        "noLang": 0,
 +
        "compile": 3,
 +
        "nameContentTab": 0,
 +
        "noCacheGetVars": "",
 +
        "noCachePostVars": "",
 +
        "useCacheForUsers": 0,
 +
        "cacheExpire": 0,
 +
        "cacheExpirePages": [],
 +
        "cacheExpireSelector": "",
 +
        "label": "Stellenangebote",
 +
        "tags": "",
 +
        "titleNames": 0,
 +
        "noPrependTemplateFile": 0,
 +
        "noAppendTemplateFile": 0,
 +
        "prependFile": "",
 +
        "appendFile": "",
 +
        "pagefileSecure": 0,
 +
        "tabContent": "",
 +
        "tabChildren": "",
 +
        "nameLabel": "",
 +
        "contentType": "",
 +
        "errorAction": 0,
 +
        "connectedFieldID": null,
 +
        "ns": "ProcessWire",
 +
        "_exportMode": true,
 +
        "roles": [
 +
            "guest"
 +
        ],
 +
        "fieldgroupFields": [
 +
            "title",
 +
            "layout_blocks",
 +
            "images",
 +
            "files",
 +
            "menu"
 +
        ],
 +
        "fieldgroupContexts": {
 +
            "title": [],
 +
            "layout_blocks": [],
 +
            "images": [],
 +
            "files": [],
 +
            "menu": []
 +
        }
 +
    }
 +
}
 +
</pre>
 +
 +
=== Template Jobs ===
 +
Todo besser als Layout-Block
 +
<syntaxhighlight lang="php">
 +
// JOBLIST
 +
$joblist = '';
 +
$jobs = pages('template=job,sort=-published');
 +
foreach ($jobs as $item) {
 +
  $joblist .= '<li class="joblist-item"><a href="'.$item->url.'">'.$item->title.' ('.$item->job->job_organizationname->title.')</a></div>';
 +
}
 +
$joblist = '<ul class="joblist">'.$joblist.'</ul>';
 +
</syntaxhighlight>
 
=== Template Job ===
 
=== Template Job ===
 
Benötigt im Admin Bereich nur das job Feld. In diesem sind alle anderen benötigten Felder bereits enthalten.
 
Benötigt im Admin Bereich nur das job Feld. In diesem sind alle anderen benötigten Felder bereits enthalten.
Zeile 607: Zeile 790:
 
$jsonld = $sh->jsonldJobPosting($page);
 
$jsonld = $sh->jsonldJobPosting($page);
  
// BEWERBUNGSFORMULAR WENN GESÜNSCHT
+
// BEWERBUNGSFORMULAR WENN GEWÜNSCHT
 
$contact =  $forms->render('bewerbung');
 
$contact =  $forms->render('bewerbung');
  
Zeile 648: Zeile 831:
  
 
$content = ob_get_clean();
 
$content = ob_get_clean();
 +
</syntaxhighlight>
 +
 +
=== Bewerbungsformular ===
 +
<pre>
 +
{
 +
    "required": false,
 +
    "columnWidth": 0,
 +
    "roles": {
 +
        "form-submit": [
 +
            "guest"
 +
        ],
 +
        "form-list": [],
 +
        "form-edit": [],
 +
        "form-delete": [],
 +
        "entries-list": [],
 +
        "entries-edit": [],
 +
        "entries-delete": [],
 +
        "entries-page": [],
 +
        "entries-resend": []
 +
    },
 +
    "flags": 256,
 +
    "pluginActions": [],
 +
    "framework": "Uikit3",
 +
    "allowPreset": 0,
 +
    "skipSessionKey": 0,
 +
    "useCookies": 0,
 +
    "partialEntryDays": 14,
 +
    "spamEntryDays": 7,
 +
    "submitText": "Absenden",
 +
    "successMessage": "Vielen Dank - Ihre Bewerbung wurde versendet.",
 +
    "errorMessage": "Ein Fehler ist aufgetreten. Bitte überprüfen Sie Ihre Eingaben.",
 +
    "mobilePx": 0,
 +
    "frBasic_noLoad": [],
 +
    "frBasic_cssURL": "/site/modules/FormBuilder/frameworks/basic/main.css",
 +
    "frBasic_itemContent": [
 +
        "description",
 +
        "out",
 +
        "error",
 +
        "notes"
 +
    ],
 +
    "spamFlags": 0,
 +
    "listFields": [],
 +
    "entryDays": 0,
 +
    "emailSubject": "Bewerbungsformular auf salus-klinik.de",
 +
    "responderSubject": "Auto-Response",
 +
    "saveFlags": 35,
 +
    "spamWords": [],
 +
    "honeypot": "name_1",
 +
    "emailTo": "post@stephanschlegel.de",
 +
    "frUikit3_noLoad": [
 +
        "framework",
 +
        "jquery",
 +
        "jqueryui"
 +
    ],
 +
    "frUikit3_ukURL": "/site/modules/FormBuilder/frameworks/uikit3/",
 +
    "frUikit3_css": "uikit.min.css",
 +
    "frUikit3_horizontal": "0",
 +
    "frUikit3_inlineErrorBelow": "1",
 +
    "frUikit3_horizHeaderWidth": 30,
 +
    "frUikit3_buttonType": "primary",
 +
    "children": {
 +
        "name_1": {
 +
            "type": "Text",
 +
            "label": "Name",
 +
            "required": false,
 +
            "columnWidth": 0,
 +
            "collapsed": "0",
 +
            "minlength": 0,
 +
            "maxlength": 2048,
 +
            "showCount": "0",
 +
            "size": 0
 +
        },
 +
        "name_2": {
 +
            "type": "Text",
 +
            "label": "Name",
 +
            "required": 1,
 +
            "columnWidth": 0,
 +
            "collapsed": "0",
 +
            "minlength": 0,
 +
            "maxlength": 2048,
 +
            "showCount": "0",
 +
            "size": 0
 +
        },
 +
        "e_mail": {
 +
            "type": "Email",
 +
            "label": "E-Mail",
 +
            "required": 1,
 +
            "columnWidth": 0,
 +
            "collapsed": "0",
 +
            "minlength": 0,
 +
            "maxlength": 250,
 +
            "showCount": "0",
 +
            "size": 0
 +
        },
 +
        "telefon": {
 +
            "type": "Text",
 +
            "label": "Telefon",
 +
            "required": 1,
 +
            "columnWidth": 0,
 +
            "collapsed": "0",
 +
            "minlength": 0,
 +
            "maxlength": 2048,
 +
            "showCount": "0",
 +
            "size": 0
 +
        },
 +
        "bewerbungsunterlagen": {
 +
            "type": "FormBuilderFile",
 +
            "label": "Bewerbungsunterlagen",
 +
            "notes": "Maximal 3 Dateien á 5MB",
 +
            "required": false,
 +
            "columnWidth": 0,
 +
            "collapsed": "0",
 +
            "extensions": "pdf doc docx xls xlsx gif jpg jpeg png",
 +
            "maxFiles": 3,
 +
            "maxFileSize": 5242880
 +
        }
 +
    }
 +
}
 +
</pre>
 +
=== Layout Block - Job-Liste ===
 +
Beispiel Salus
 +
<syntaxhighlight lang="php">
 +
<?php namespace ProcessWire;
 +
$sectionClasses = array($page->_type);
 +
$containerClasses = array('ani section');
 +
if($page->bg && $page->bg->value) {
 +
    $colorClassBorder = $page->bg->value;
 +
    $colorClassContent = $page->bg->value;
 +
}
 +
else {
 +
    $colorClassBorder = 'bc1';
 +
    $colorClassContent = 'bc1';
 +
}
 +
 +
$out = '';
 +
$jobsMarkup = '';
 +
$jobsAccordion = new Box;
 +
$jobs = pages('template=job,sort=-published');
 +
foreach ($jobs as $item) {
 +
 +
    $jobsMarkup .= '
 +
      <li class="bc1 joblist-item">
 +
        <a class="uk-accordion-title uk-padding-small" href="#">
 +
          '.$item->title.'
 +
        </a>
 +
        <div class="uk-accordion-content uk-padding-small nmt npt">
 +
          <p><strong>'.$item->job->job_organizationname->title.'</strong></p>
 +
          <p><strong>Arbeitsort:</strong> '.$item->job->job_addresslocality.'<br>
 +
          <strong>Art der Anstellung: </strong>'.$item->job->job_employmenttype->title.'</p>
 +
          <p><a class="uk-button uk-button-primary" href="'.$item->url.'">Zur Stellenbeschreibung</a></p>
 +
        </div>
 +
      </li>
 +
    ';
 +
}
 +
 +
$jobsAccordion->addClasses('accordion uk-accordion nmb');
 +
$jobsAccordion->addAttributes('uk-accordion=""'); // i.e. active:0
 +
$out .= $jobsAccordion->wrap($jobsMarkup,'ul');
 +
 +
 +
// RANDSPALTE?
 +
$out = '
 +
<div class="uk-grid uk-grid-collapse uk-grid-match" uk-grid>
 +
    <div class="uk-visible@m uk-width-1-5 '.$colorClassBorder.'">
 +
        <div class="uk-padding-small">
 +
        </div>
 +
    </div>
 +
 +
    <div class="uk-width-expand@m">
 +
        <div class="uk-padding npt npb npr">
 +
            '.renderHeadline($page).'
 +
            '. $out .'
 +
        </div>
 +
    </div>
 +
</div>
 +
';
 +
//$out = renderContainer($page,$out,$containerClasses);
 +
$out = renderSection($page,$out,$sectionClasses,array('skipDefaultClasses'=>false));
 +
return $out;
 +
 +
</syntaxhighlight>
 +
 +
==== Bewerberformular vorausfüllen mit verschiedenen Ansprechpartnern ====
 +
Das Formular soll versendet werden mit
 +
- Titel der Stellenanzeige (nicht veränderbar)
 +
- Name der Einrichtung (nicht veränderbar)
 +
- an verschiedene E-Mail Adressen, je nach Einrichtung für die die Stellenanzeige gilt.
 +
 +
ready.php
 +
<syntaxhighlight lang="php">
 +
<?php namespace ProcessWire;
 +
 +
if(!defined("PROCESSWIRE")) die();
 +
 +
$emailList = array(
 +
  'intensiv' => 'intensiv@sp-ps.de',
 +
  'karlsruhe' => 'info@sp-ps.de',
 +
  'rastatt' => 'oetigheim@sp-ps.de',
 +
  'pforzheim' => 'info-pf@sp-ps.de',
 +
  'rheinhausen' => 'info-oh@sp-ps.de',
 +
  'tagespflege' => 'oetigheim@sp-ps.de',
 +
);
 +
 +
// HOOKS FÜR BEWERBUNG IM JOBTEMPLATE
 +
if($page->template->name=='job'){
 +
  $formname = 'schnellkontakt';
 +
  // E-Mails (Wert aus Template 'job' Feld: job_organizationname => Mailadresse)
 +
  $organization = $page->job->job_organizationname->title;
 +
  $organizationName = $page->job->job_organizationname->value;
 +
  $jobtitle = $page->title;
 +
 +
  $wire->addHookBefore('FormBuilderProcessor::renderReady',
 +
    function($event) use($organization, $jobtitle, $formname) {
 +
     
 +
      $form = $event->arguments(0);
 +
      if($form->name !== $formname) return;
 +
      $form->getChildByName('ich_bewerbe_mich_fur_folgende_einrichtung')
 +
        ->val($organization)
 +
        ->attr('disabled', 'disabled');
 +
      $form->getChildByName('ich_bewerbe_mich_als')
 +
        ->val($jobtitle)
 +
        ->attr('disabled', 'disabled');
 +
    }
 +
  );
 +
  // nach dem übermitteln der eingaben (user kann nichts mehr ändern)
 +
  $wire->addHook('FormBuilderProcessor::processInputDone',
 +
    function($event) use($organization, $jobtitle, $formname) {
 +
      $form = $event->arguments(0);
 +
      if($form->name !== $formname) return;
 +
      $form->getChildByName('ich_bewerbe_mich_fur_folgende_einrichtung')->val($organization);
 +
      $form->getChildByName('ich_bewerbe_mich_als')->val($jobtitle); 
 +
    }
 +
  );
 +
  // change email based on job
 +
  $wire->addHookBefore('FormBuilderProcessor::emailForm',
 +
    function($event) use($organizationName, $emailList, $formname) {
 +
      $processor = $event->object;
 +
      if($processor->formName != $formname) return;
 +
      if(array_key_exists($organizationName,$emailList)){
 +
        $processor->emailTo = $emailList[$organizationName]; // tell FormBuilder to use that email
 +
      }
 +
    }
 +
  );
 +
}else{
 +
  // HOOKS FÜR INITIATIVBEWERBUNG
 +
  // change email based on job
 +
  $wire->addHookBefore('FormBuilderProcessor::emailForm',
 +
    function($event) use($emailList) {
 +
      $processor = $event->object;
 +
      if($processor->formName != 'initiativbewerbung') return;
 +
      $form = $event->arguments(0);
 +
      $name = $form->getChildByName('ich_bewerbe_mich_fur_folgende_einrichtung')->val();
 +
      if(array_key_exists($name,$emailList)){
 +
        $processor->emailTo = $emailList[$name]; // tell FormBuilder to use that email
 +
      }
 +
    }
 +
  );
 +
}
 +
 +
 +
 +
 +
 +
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Zeile 655: Zeile 1.102:
  
 
<syntaxhighlight lang="php">
 
<syntaxhighlight lang="php">
 +
<?php namespace ProcessWire;
 +
/**
 +
* SchemaHelper
 +
* Class for structured data
 +
* V1.0
 +
*/
 +
// @todo outsource some of the nessecary types (i.e. place) in backend use
 +
// fieldgroups for that maybe s.th. like $place = getFg('schema_place')
 +
class SchemaHelper{
 +
// Load the requested schema from the schemas directory and register the class
 +
public function jsonldJobPosting ($p) {
 +
$jsonld = array();
 +
$sanitizer = wire('sanitizer');
 +
//set unset fields (for not mandatory fields)
 +
$p->job->job_validthrough = $p->job->job_validthrough ? : ''; // todo test
 +
 +
$jsonld["@context"] = "http://schema.org/";
 +
$jsonld["@type"] = "JobPosting";
 +
if($p->job->job_link) $jsonld["url"] = $p->job->job_link;
 +
else $jsonld["url"] = $sanitizer->url($p->httpUrl);
 +
$jsonld["datePosted"] = !empty($p->job->job_dateposted) ? date('Y-m-d', $p->job->getUnformatted('job_dateposted') ) : date('Y-m-d', strtotime($p->created));
 +
$jsonld["validThrough"] = date('Y-m-d', $p->job->getUnformatted('job_validthrough') );
 +
$jsonld["description"] = $sanitizer->textarea($p->job->job_description);
 +
$jsonld['hiringOrganization'] = array(
 +
"@type" => "Organization",
 +
"name" => $sanitizer->text($p->job->job_organizationname->title),
 +
"sameAs" => $sanitizer->url($p->job->job_link)
 +
);
 +
if($p->job->link2)$jsonld['hiringOrganization']['logo'] = $p->job->link2;
 +
$jsonld['title'] = $sanitizer->text($p->title);
 +
 +
if($p->job->job_basesalary_minvalue && $p->job->job_basesalary_maxvalue && $p->job->job_basesalary_unittext){
 +
$jsonld['baseSalary'] = array(
 +
"@type" => "MonetaryAmount",
 +
"currency" => "EUR",
 +
"value" => array(
 +
"@type" => "QuantitativeValue",
 +
"minValue" => $sanitizer->float($p->job->job_basesalary_minvalue),
 +
"maxValue" => $sanitizer->float($p->job->job_basesalary_maxvalue),
 +
"unitText" => $sanitizer->text($p->job->job_basesalary_unittext->value)
 +
)
 +
);
 +
}else if($p->job->job_basesalary_minvalue && $p->job->job_basesalary_unittext){
 +
$jsonld['baseSalary'] = array(
 +
"@type" => "MonetaryAmount",
 +
"currency" => "EUR",
 +
"value" => array(
 +
"@type" => "QuantitativeValue",
 +
"value" => $sanitizer->float($p->job->job_basesalary_minvalue),
 +
"unitText" => $sanitizer->text($p->job->job_basesalary_unittext->value)
 +
)
 +
);
 +
}
 +
$jsonld['jobLocation'] = array(
 +
"@type" => "Place",
 +
"address" => array(
 +
"@type" => "PostalAddress",
 +
"streetAddress" => $sanitizer->text($p->job->job_streetaddress),
 +
"addressLocality" => $sanitizer->text($p->job->job_addresslocality),
 +
"addressRegion" => $sanitizer->text($p->job->job_addressregion),
 +
"postalCode" => $sanitizer->text($p->job->job_postalcode),
 +
"addressCountry" => $sanitizer->text($p->job->job_addresscountry),
 +
)
 +
);
 +
// recommended properties
 +
 +
if($c = count($p->job->job_employmenttype)){
 +
$types = array();
 +
foreach($p->job->job_employmenttype as $type){
 +
$types[] = $sanitizer->text($type->value);
 +
}
 +
//var_dump($c);
 +
if($c > 1) $jsonld['employmentType'] = $types;
 +
else $jsonld['employmentType'] = $types[0];
 +
}
 +
 +
//$out .= '<script type="application/ld+json">' . json_encode($jsonld) . '</script>';
 +
$out = '<script type="application/ld+json">' . json_encode($jsonld,JSON_PRETTY_PRINT) . '</script>';
 +
 +
return $out;
 +
}
 +
 +
}
  
 
</syntaxhighlight>
 
</syntaxhighlight>

Aktuelle Version vom 12. Dezember 2025, 10:02 Uhr

Links[Bearbeiten]

ProcessWire - Job Modul

Beispiel Setting für Jobs mit strukturierten Daten[Bearbeiten]

Beispiel von SPPS

Job Template[Bearbeiten]

Felder[Bearbeiten]

{
    "job_addresscountry": {
        "id": 191,
        "name": "job_addresscountry",
        "label": "Land",
        "flags": 0,
        "type": "FieldtypeText",
        "textformatters": [
            "TextformatterEntities"
        ],
        "minlength": 0,
        "maxlength": 2048,
        "showCount": 0,
        "size": 0,
        "collapsed": 0,
        "inputfieldClass": "",
        "showIf": "",
        "themeInputSize": "",
        "themeInputWidth": "",
        "themeOffset": "",
        "themeBorder": "",
        "themeColor": "",
        "themeBlank": "",
        "columnWidth": 100,
        "required": "",
        "requiredAttr": "",
        "requiredIf": "",
        "stripTags": "",
        "placeholder": "",
        "pattern": ""
    },
    "job_addresslocality": {
        "id": 188,
        "name": "job_addresslocality",
        "label": "Ort",
        "flags": 0,
        "type": "FieldtypeText",
        "textformatters": [
            "TextformatterEntities"
        ],
        "minlength": 0,
        "maxlength": 2048,
        "showCount": 0,
        "size": 0,
        "collapsed": 0,
        "inputfieldClass": "",
        "showIf": "",
        "themeInputSize": "",
        "themeInputWidth": "",
        "themeOffset": "",
        "themeBorder": "",
        "themeColor": "",
        "themeBlank": "",
        "columnWidth": 100,
        "required": "",
        "requiredAttr": "",
        "requiredIf": "",
        "stripTags": "",
        "placeholder": "",
        "pattern": ""
    },
    "job_addressregion": {
        "id": 189,
        "name": "job_addressregion",
        "label": "Job Region",
        "flags": 0,
        "type": "FieldtypeText",
        "textformatters": [
            "TextformatterEntities"
        ],
        "minlength": 0,
        "maxlength": 2048,
        "showCount": 0,
        "size": 0,
        "collapsed": 0,
        "inputfieldClass": "",
        "showIf": "",
        "themeInputSize": "",
        "themeInputWidth": "",
        "themeOffset": "",
        "themeBorder": "",
        "themeColor": "",
        "themeBlank": "",
        "columnWidth": 100,
        "required": "",
        "requiredAttr": "",
        "requiredIf": "",
        "stripTags": "",
        "placeholder": "",
        "pattern": ""
    },
    "job_basesalary_maxvalue": {
        "id": 185,
        "name": "job_basesalary_maxvalue",
        "label": "job_basesalary_maxvalue",
        "flags": 0,
        "type": "FieldtypeInteger",
        "zeroNotEmpty": 0,
        "columnWidth": 33,
        "inputType": "text",
        "size": 10,
        "collapsed": 0,
        "defaultValue": "",
        "showIf": "",
        "themeOffset": "",
        "themeBorder": "",
        "themeColor": "",
        "required": "",
        "requiredIf": "",
        "min": "",
        "max": ""
    },
    "job_basesalary_minvalue": {
        "id": 184,
        "name": "job_basesalary_minvalue",
        "label": "job_basesalary_minvalue",
        "flags": 0,
        "type": "FieldtypeInteger",
        "zeroNotEmpty": 0,
        "collapsed": 0,
        "columnWidth": 33,
        "inputType": "text",
        "size": 10,
        "defaultValue": "",
        "showIf": "",
        "themeOffset": "",
        "themeBorder": "",
        "themeColor": "",
        "required": "",
        "requiredIf": "",
        "min": "",
        "max": ""
    },
    "job_basesalary_unittext": {
        "id": 186,
        "name": "job_basesalary_unittext",
        "label": "Bezahlung pro",
        "flags": 0,
        "type": "FieldtypeOptions",
        "inputfieldClass": "InputfieldSelect",
        "collapsed": 0,
        "columnWidth": 33,
        "initValue": "",
        "showIf": "",
        "themeInputSize": "",
        "themeInputWidth": "",
        "themeOffset": "",
        "themeBorder": "",
        "themeColor": "",
        "required": "",
        "requiredIf": "",
        "defaultValue": "",
        "export_options": {
            "default": "1=MONTH|Monat\n2=YEAR|Jahr\n3=HOUR|Stunde\n4=WEEK|Woche\n5=DAY|Tag"
        }
    },
    "job_dateposted": {
        "id": 179,
        "name": "job_dateposted",
        "label": "Job Datum",
        "flags": 0,
        "type": "FieldtypeDatetime",
        "collapsed": 0,
        "inputType": "text",
        "htmlType": "date",
        "dateSelectFormat": "yMd",
        "yearFrom": 1922,
        "yearTo": 2042,
        "yearLock": 0,
        "datepicker": 3,
        "timeInputSelect": 0,
        "dateInputFormat": "Y-m-d",
        "size": 25,
        "columnWidth": 25,
        "notes": "Datum des Postings",
        "defaultToday": 1,
        "dateOutputFormat": "",
        "showIf": "",
        "themeOffset": "",
        "themeBorder": "",
        "themeColor": "",
        "required": "",
        "requiredAttr": "",
        "requiredIf": "",
        "dateMin": "",
        "dateMax": "",
        "timeStep": "",
        "timeMin": "",
        "timeMax": "",
        "timeInputFormat": "",
        "placeholder": "",
        "yearRange": ""
    },
    "job_description": {
        "id": 181,
        "name": "job_description",
        "label": "job_description",
        "flags": 0,
        "type": "FieldtypeTextareaLanguage",
        "inputfieldClass": "InputfieldCKEditor",
        "contentType": 1,
        "minlength": 0,
        "maxlength": 0,
        "showCount": 0,
        "rows": 5,
        "textformatters": [
            "TextformatterHannaCode"
        ],
        "htmlOptions": [
            2,
            4,
            16
        ],
        "langBlankInherit": 0,
        "collapsed": 0,
        "toolbar": "Format, Styles, -, Bold, Italic, -, RemoveFormat\nNumberedList, BulletedList, -, Blockquote\nPWLink, Unlink, Anchor\nPWImage, Table, HorizontalRule, SpecialChar\nPasteText, PasteFromWord\nScayt, -, Sourcedialog\nJustifyCenter, JustifyLeft, JustifyRight",
        "inlineMode": 0,
        "useACF": 1,
        "usePurifier": 1,
        "formatTags": "p;h1;h2;h3;h4;h5;h6;pre;address",
        "contentsCss": "/site/templates/modules/InputfieldCKEditor/contents.css",
        "stylesSet": "customstyles:/site/templates/modules/InputfieldCKEditor/mystyles.js",
        "extraPlugins": [
            "pwimage",
            "pwlink",
            "sourcedialog"
        ],
        "removePlugins": "image,magicline",
        "showIf": "",
        "themeOffset": "",
        "themeBorder": "",
        "themeColor": "",
        "columnWidth": 100,
        "required": "",
        "requiredAttr": "",
        "requiredIf": "",
        "imageFields": "",
        "toggles": "",
        "extraAllowedContent": "",
        "contentsInlineCss": "",
        "customOptions": "",
        "plugin_sourcedialog": ""
    },
    "job_employmenttype": {
        "id": 192,
        "name": "job_employmenttype",
        "label": "Art der Anstellung",
        "flags": 0,
        "type": "FieldtypeOptions",
        "inputfieldClass": "InputfieldSelect",
        "collapsed": 0,
        "initValue": "",
        "showIf": "",
        "themeInputSize": "",
        "themeInputWidth": "",
        "themeOffset": "",
        "themeBorder": "",
        "themeColor": "",
        "columnWidth": 100,
        "required": "",
        "requiredIf": "",
        "defaultValue": "",
        "export_options": {
            "default": "1=FULL_TIME|Vollzeit\n2=PART_TIME|Teilzeit\n3=CONTRACTOR|Vertrag\n4=TEMPORARY|Zeitarbeit\n5=INTERN|Internship (Trainee etc.)\n6=VOLUNTEER|Volontariat\n7=PER_DIEM|Per diem\n8=OTHER|Andere"
        }
    },
    "job_link": {
        "id": 178,
        "name": "job_link",
        "label": "Link zum Jobangebot",
        "flags": 0,
        "type": "FieldtypeURL",
        "textformatters": [
            "TextformatterEntities"
        ],
        "noRelative": 0,
        "allowIDN": 0,
        "allowQuotes": 0,
        "addRoot": 0,
        "collapsed": 0,
        "minlength": 0,
        "maxlength": 1024,
        "showCount": 0,
        "size": 0,
        "showIf": "",
        "themeInputSize": "",
        "themeInputWidth": "",
        "themeOffset": "",
        "themeBorder": "",
        "themeColor": "",
        "themeBlank": "",
        "columnWidth": 100,
        "required": "",
        "requiredAttr": "",
        "requiredIf": "",
        "placeholder": "",
        "pattern": ""
    },
    "job_logo": {
        "id": 183,
        "name": "job_logo",
        "label": "Logo",
        "flags": 0,
        "type": "FieldtypeImage",
        "fileSchema": 270,
        "textformatters": [
            "TextformatterEntities"
        ],
        "extensions": "gif jpg jpeg png",
        "maxFiles": 0,
        "outputFormat": 2,
        "descriptionRows": 1,
        "useTags": 0,
        "gridMode": "grid",
        "focusMode": "on",
        "resizeServer": 0,
        "clientQuality": 90,
        "maxReject": "",
        "dimensionsByAspectRatio": "",
        "defaultValuePage": "",
        "inputfieldClass": "InputfieldImage",
        "notes": "optional",
        "collapsed": 0,
        "outputString": "",
        "noLang": "",
        "entityEncode": "",
        "tagsList": "",
        "showIf": "",
        "themeOffset": "",
        "themeBorder": "",
        "themeColor": "",
        "columnWidth": 100,
        "required": "",
        "requiredIf": "",
        "unzip": "",
        "overwrite": "",
        "maxWidth": "",
        "maxHeight": "",
        "maxSize": "",
        "minWidth": "",
        "minHeight": "",
        "aspect_ratios": ""
    },
    "job_organizationname": {
        "id": 193,
        "name": "job_organizationname",
        "label": "Name der Organisation",
        "flags": 0,
        "type": "FieldtypeOptions",
        "inputfieldClass": "InputfieldSelect",
        "collapsed": 0,
        "initValue": "",
        "showIf": "",
        "themeInputSize": "",
        "themeInputWidth": "",
        "themeOffset": "",
        "themeBorder": "",
        "themeColor": "",
        "columnWidth": 100,
        "required": "",
        "requiredIf": "",
        "defaultValue": "",
        "export_options": {
            "default": "1=intensiv|SPPS Karlsruhe Intensiv\n2=karlsruhe|SPPS Karlsruhe\n3=rastatt|SPPS Ötigheim/Rastatt\n4=pforzheim|SPPS Pforzheim\n5=rheinhausen|SPPS Rheinhausen-Oberhausen\n6=tagespflege|Tagespflege Etje"
        }
    },
    "job_organizationname_old": {
        "id": 182,
        "name": "job_organizationname_old",
        "label": "Name der Organisation",
        "flags": 0,
        "type": "FieldtypeText",
        "collapsed": 0,
        "minlength": 0,
        "maxlength": 2048,
        "showCount": 0,
        "size": 0,
        "textformatters": "",
        "inputfieldClass": "",
        "showIf": "",
        "themeInputSize": "",
        "themeInputWidth": "",
        "themeOffset": "",
        "themeBorder": "",
        "themeColor": "",
        "themeBlank": "",
        "columnWidth": 100,
        "required": "",
        "requiredAttr": "",
        "requiredIf": "",
        "stripTags": "",
        "placeholder": "",
        "pattern": ""
    },
    "job_postalcode": {
        "id": 190,
        "name": "job_postalcode",
        "label": "PLZ",
        "flags": 0,
        "type": "FieldtypeText",
        "textformatters": [
            "TextformatterEntities"
        ],
        "minlength": 0,
        "maxlength": 2048,
        "showCount": 0,
        "size": 0,
        "collapsed": 0,
        "inputfieldClass": "",
        "showIf": "",
        "themeInputSize": "",
        "themeInputWidth": "",
        "themeOffset": "",
        "themeBorder": "",
        "themeColor": "",
        "themeBlank": "",
        "columnWidth": 100,
        "required": "",
        "requiredAttr": "",
        "requiredIf": "",
        "stripTags": "",
        "placeholder": "",
        "pattern": ""
    },
    "job_streetaddress": {
        "id": 187,
        "name": "job_streetaddress",
        "label": "Adresse",
        "flags": 0,
        "type": "FieldtypeText",
        "textformatters": [
            "TextformatterEntities"
        ],
        "collapsed": 0,
        "minlength": 0,
        "maxlength": 2048,
        "showCount": 0,
        "size": 0,
        "inputfieldClass": "",
        "showIf": "",
        "themeInputSize": "",
        "themeInputWidth": "",
        "themeOffset": "",
        "themeBorder": "",
        "themeColor": "",
        "themeBlank": "",
        "columnWidth": 100,
        "required": "",
        "requiredAttr": "",
        "requiredIf": "",
        "stripTags": "",
        "placeholder": "",
        "pattern": ""
    },
    "job_validthrough": {
        "id": 180,
        "name": "job_validthrough",
        "label": "Gültig bis",
        "flags": 0,
        "type": "FieldtypeDatetime",
        "inputType": "text",
        "htmlType": "date",
        "dateSelectFormat": "yMd",
        "yearFrom": 1922,
        "yearTo": 2042,
        "yearLock": 0,
        "datepicker": 3,
        "timeInputSelect": 0,
        "dateInputFormat": "Y-m-d",
        "size": 25,
        "columnWidth": 25,
        "collapsed": 0,
        "dateOutputFormat": "",
        "showIf": "",
        "themeOffset": "",
        "themeBorder": "",
        "themeColor": "",
        "required": "",
        "requiredAttr": "",
        "requiredIf": "",
        "dateMin": "",
        "dateMax": "",
        "timeStep": "",
        "timeMin": "",
        "timeMax": "",
        "timeInputFormat": "",
        "placeholder": "",
        "yearRange": "",
        "defaultToday": ""
    }
}

Options für:

job_basesalary_unittext

1=MONTH|Monat
2=YEAR|Jahr
3=HOUR|Stunde
4=WEEK|Woche
5=DAY|Tag

job_employmenttype

1=FULL_TIME|Vollzeit
2=PART_TIME|Teilzeit
3=CONTRACTOR|Vertrag
4=TEMPORARY|Zeitarbeit
5=INTERN|Internship (Trainee etc.)
6=VOLUNTEER|Volontariat
7=PER_DIEM|Per diem
8=OTHER|Andere

job_organizationname

kann genutzt werden wenn man mehrere Organisationen hat

Job Fieldset Page

Das Feld fasst die anderen Felder in eines zusammen. So kann man sie einfacher handeln.

{
    "job": {
        "id": 177,
        "name": "job",
        "label": "Job",
        "flags": 0,
        "type": "FieldtypeFieldsetPage",
        "notes": "Daten für ein Jobposting",
        "icon": "wrench",
        "template_id": 0,
        "parent_id": 0,
        "repeaterLoading": 2,
        "repeaterMaxItems": 1,
        "repeaterMinItems": 1,
        "collapsed": 0,
        "repeaterFields": [
            "job_dateposted",
            "job_validthrough",
            "job_organizationname",
            "job_description",
            "job_basesalary_minvalue",
            "job_basesalary_maxvalue",
            "job_basesalary_unittext",
            "job_streetaddress",
            "job_postalcode",
            "job_addresslocality",
            "job_addressregion",
            "job_addresscountry",
            "job_employmenttype",
            "job_link",
            "job_logo"
        ],
        "showIf": "",
        "themeOffset": "",
        "themeBorder": "",
        "themeColor": "",
        "columnWidth": 100,
        "required": "",
        "requiredIf": "",
        "fieldContexts": {
            "job_dateposted": {
                "icon": "calendar",
                "notes": "Datum des Postings. Wenn leer wird das Erstelldatum dieser Seite verwendet."
            },
            "job_validthrough": {
                "icon": "calendar",
                "notes": "Empfohlen. Unbefristet für manche Berufsgruppen erlaubt (z.B. Bedienungen)"
            },
            "job_organizationname": [],
            "job_description": [],
            "job_basesalary_minvalue": [],
            "job_basesalary_maxvalue": [],
            "job_basesalary_unittext": [],
            "job_streetaddress": [],
            "job_postalcode": [],
            "job_addresslocality": [],
            "job_addressregion": [],
            "job_addresscountry": [],
            "job_employmenttype": [],
            "job_link": {
                "notes": "Wenn leer wird diese Seite genutzt."
            },
            "job_logo": []
        }
    }
}

Templates Import[Bearbeiten]

Import Daten (Zulässige Kind/Elternseiten von Hand nachtragen)

{
    "job": {
        "id": 53,
        "name": "job",
        "fieldgroups_id": "job",
        "flags": 0,
        "cache_time": 0,
        "useRoles": 1,
        "editRoles": [],
        "addRoles": [],
        "createRoles": [],
        "rolesPermissions": [],
        "noInherit": 0,
        "childrenTemplatesID": 0,
        "sortfield": "",
        "noChildren": 1,
        "noParents": "",
        "childTemplates": [],
        "parentTemplates": [
            "jobs"
        ],
        "allowPageNum": 0,
        "allowChangeUser": 0,
        "redirectLogin": 0,
        "urlSegments": 0,
        "https": 0,
        "slashUrls": 1,
        "slashPageNum": 0,
        "slashUrlSegments": 0,
        "altFilename": "",
        "guestSearchable": 0,
        "pageClass": "",
        "childNameFormat": "",
        "pageLabelField": "fa-user-circle-o title",
        "noGlobal": 0,
        "noMove": 0,
        "noTrash": 0,
        "noSettings": 0,
        "noChangeTemplate": 0,
        "noShortcut": 0,
        "noUnpublish": 0,
        "noLang": 0,
        "compile": 3,
        "nameContentTab": 0,
        "noCacheGetVars": "",
        "noCachePostVars": "",
        "useCacheForUsers": 0,
        "cacheExpire": 0,
        "cacheExpirePages": [],
        "cacheExpireSelector": "",
        "label": "Stellenangebot",
        "tags": "",
        "titleNames": 0,
        "noPrependTemplateFile": 0,
        "noAppendTemplateFile": 0,
        "prependFile": "",
        "appendFile": "",
        "pagefileSecure": 0,
        "tabContent": "",
        "tabChildren": "",
        "nameLabel": "",
        "contentType": "",
        "errorAction": 0,
        "connectedFieldID": null,
        "ns": "ProcessWire",
        "_exportMode": true,
        "roles": [
            "guest"
        ],
        "fieldgroupFields": [
            "title",
            "layout_blocks",
            "job"
        ],
        "fieldgroupContexts": {
            "title": [],
            "layout_blocks": [],
            "job": []
        }
    },
    "jobs": {
        "id": 55,
        "name": "jobs",
        "fieldgroups_id": "jobs",
        "flags": 0,
        "cache_time": 0,
        "useRoles": 1,
        "editRoles": [],
        "addRoles": [],
        "createRoles": [],
        "rolesPermissions": [],
        "noInherit": 0,
        "childrenTemplatesID": 0,
        "sortfield": "",
        "noChildren": "",
        "noParents": -1,
        "childTemplates": [
            "job"
        ],
        "parentTemplates": [],
        "allowPageNum": 1,
        "allowChangeUser": 0,
        "redirectLogin": 0,
        "urlSegments": 0,
        "https": 0,
        "slashUrls": 1,
        "slashPageNum": 0,
        "slashUrlSegments": 0,
        "altFilename": "",
        "guestSearchable": 0,
        "pageClass": "",
        "childNameFormat": "",
        "pageLabelField": "fa-users title",
        "noGlobal": 0,
        "noMove": 0,
        "noTrash": 0,
        "noSettings": 0,
        "noChangeTemplate": 0,
        "noShortcut": 0,
        "noUnpublish": 0,
        "noLang": 0,
        "compile": 3,
        "nameContentTab": 0,
        "noCacheGetVars": "",
        "noCachePostVars": "",
        "useCacheForUsers": 0,
        "cacheExpire": 0,
        "cacheExpirePages": [],
        "cacheExpireSelector": "",
        "label": "Stellenangebote",
        "tags": "",
        "titleNames": 0,
        "noPrependTemplateFile": 0,
        "noAppendTemplateFile": 0,
        "prependFile": "",
        "appendFile": "",
        "pagefileSecure": 0,
        "tabContent": "",
        "tabChildren": "",
        "nameLabel": "",
        "contentType": "",
        "errorAction": 0,
        "connectedFieldID": null,
        "ns": "ProcessWire",
        "_exportMode": true,
        "roles": [
            "guest"
        ],
        "fieldgroupFields": [
            "title",
            "layout_blocks",
            "images",
            "files",
            "menu"
        ],
        "fieldgroupContexts": {
            "title": [],
            "layout_blocks": [],
            "images": [],
            "files": [],
            "menu": []
        }
    }
}

Template Jobs[Bearbeiten]

Todo besser als Layout-Block

// JOBLIST
$joblist = '';
$jobs = pages('template=job,sort=-published');
foreach ($jobs as $item) {
  $joblist .= '<li class="joblist-item"><a href="'.$item->url.'">'.$item->title.' ('.$item->job->job_organizationname->title.')</a></div>';
}
$joblist = '<ul class="joblist">'.$joblist.'</ul>';

Template Job[Bearbeiten]

Benötigt im Admin Bereich nur das job Feld. In diesem sind alle anderen benötigten Felder bereits enthalten.

<?php namespace ProcessWire;
include_once('includes/SchemaHelper.php');
$sh = new SchemaHelper;
$jsonld = $sh->jsonldJobPosting($page);

// BEWERBUNGSFORMULAR WENN GEWÜNSCHT
$contact =  $forms->render('bewerbung');

ob_start();
?>

<div class="container">
  <div id="apply">
    <h1><?=$page->title?></h1>
      <div class="job-description">
        <?=$page->job->job_description?>
      </div>
      <div class="">Arbeitgeber</div>
        <?=$page->job->job_organizationname->title?><br>
	<?=$page->link?>
      </div>
      <div class="font-heavy">Arbeitsort</div>
        <?=$page->job->job_streetaddress?><br>
        <?=$page->job->job_postalcode?> <?=$page->job->job_addresslocality?>
      </div>
      <?php if ($page->job->job_basesalary_minvalue && $page->job->job_basesalary_maxvalue && $page->job->job_basesalary_unittext): ?>
        <div class="font-heavy">Vergütung</div>
        <div><?=$page->job->job_basesalary_minvalue?>€ - <?=$page->job->job_basesalary_maxvalue?><?=$page->job->job_basesalary_unittext->title?></div>
      <?php elseif($page->job->job_basesalary_minvalue && $page->job->job_basesalary_unittext): ?>
        <div class="font-heavy">Vergütung</div>
	<div><?=$page->job->job_basesalary_minvalue?><?=$page->unit->title?></div>
      <?php endif ?>
      <div class="font-heavy pt-20">Art der Anstellung</div>
      <div class="pb-30"><?=$page->job->job_employmenttype->title?></div>
    </div>
    <!-- Bewerbungsmöglichkeit -->
    <div id="apply-form" class="">
      <h2>Bewerbung</h2>
      <div><?= $contact ?></div>
    </div>
    <!-- job ldjson -->
    <?=$jsonld?>
  </div>
<?php

$content = ob_get_clean();

Bewerbungsformular[Bearbeiten]

{
    "required": false,
    "columnWidth": 0,
    "roles": {
        "form-submit": [
            "guest"
        ],
        "form-list": [],
        "form-edit": [],
        "form-delete": [],
        "entries-list": [],
        "entries-edit": [],
        "entries-delete": [],
        "entries-page": [],
        "entries-resend": []
    },
    "flags": 256,
    "pluginActions": [],
    "framework": "Uikit3",
    "allowPreset": 0,
    "skipSessionKey": 0,
    "useCookies": 0,
    "partialEntryDays": 14,
    "spamEntryDays": 7,
    "submitText": "Absenden",
    "successMessage": "Vielen Dank - Ihre Bewerbung wurde versendet.",
    "errorMessage": "Ein Fehler ist aufgetreten. Bitte überprüfen Sie Ihre Eingaben.",
    "mobilePx": 0,
    "frBasic_noLoad": [],
    "frBasic_cssURL": "/site/modules/FormBuilder/frameworks/basic/main.css",
    "frBasic_itemContent": [
        "description",
        "out",
        "error",
        "notes"
    ],
    "spamFlags": 0,
    "listFields": [],
    "entryDays": 0,
    "emailSubject": "Bewerbungsformular auf salus-klinik.de",
    "responderSubject": "Auto-Response",
    "saveFlags": 35,
    "spamWords": [],
    "honeypot": "name_1",
    "emailTo": "post@stephanschlegel.de",
    "frUikit3_noLoad": [
        "framework",
        "jquery",
        "jqueryui"
    ],
    "frUikit3_ukURL": "/site/modules/FormBuilder/frameworks/uikit3/",
    "frUikit3_css": "uikit.min.css",
    "frUikit3_horizontal": "0",
    "frUikit3_inlineErrorBelow": "1",
    "frUikit3_horizHeaderWidth": 30,
    "frUikit3_buttonType": "primary",
    "children": {
        "name_1": {
            "type": "Text",
            "label": "Name",
            "required": false,
            "columnWidth": 0,
            "collapsed": "0",
            "minlength": 0,
            "maxlength": 2048,
            "showCount": "0",
            "size": 0
        },
        "name_2": {
            "type": "Text",
            "label": "Name",
            "required": 1,
            "columnWidth": 0,
            "collapsed": "0",
            "minlength": 0,
            "maxlength": 2048,
            "showCount": "0",
            "size": 0
        },
        "e_mail": {
            "type": "Email",
            "label": "E-Mail",
            "required": 1,
            "columnWidth": 0,
            "collapsed": "0",
            "minlength": 0,
            "maxlength": 250,
            "showCount": "0",
            "size": 0
        },
        "telefon": {
            "type": "Text",
            "label": "Telefon",
            "required": 1,
            "columnWidth": 0,
            "collapsed": "0",
            "minlength": 0,
            "maxlength": 2048,
            "showCount": "0",
            "size": 0
        },
        "bewerbungsunterlagen": {
            "type": "FormBuilderFile",
            "label": "Bewerbungsunterlagen",
            "notes": "Maximal 3 Dateien á 5MB",
            "required": false,
            "columnWidth": 0,
            "collapsed": "0",
            "extensions": "pdf doc docx xls xlsx gif jpg jpeg png",
            "maxFiles": 3,
            "maxFileSize": 5242880
        }
    }
}

Layout Block - Job-Liste[Bearbeiten]

Beispiel Salus

<?php namespace ProcessWire;
$sectionClasses = array($page->_type);
$containerClasses = array('ani section');
if($page->bg && $page->bg->value) {
    $colorClassBorder = $page->bg->value;
    $colorClassContent = $page->bg->value;
}
else {
    $colorClassBorder = 'bc1';
    $colorClassContent = 'bc1';
}

$out = '';
$jobsMarkup = '';
$jobsAccordion = new Box;
$jobs = pages('template=job,sort=-published');
foreach ($jobs as $item) {

    $jobsMarkup .= '
      <li class="bc1 joblist-item">
        <a class="uk-accordion-title uk-padding-small" href="#">
          '.$item->title.'
        </a>
        <div class="uk-accordion-content uk-padding-small nmt npt">
          <p><strong>'.$item->job->job_organizationname->title.'</strong></p>
          <p><strong>Arbeitsort:</strong> '.$item->job->job_addresslocality.'<br>
          <strong>Art der Anstellung: </strong>'.$item->job->job_employmenttype->title.'</p>
          <p><a class="uk-button uk-button-primary" href="'.$item->url.'">Zur Stellenbeschreibung</a></p>
        </div>
      </li>
    ';
}

$jobsAccordion->addClasses('accordion uk-accordion nmb');
$jobsAccordion->addAttributes('uk-accordion=""'); // i.e. active:0
$out .= $jobsAccordion->wrap($jobsMarkup,'ul');


// RANDSPALTE?
$out = '
<div class="uk-grid uk-grid-collapse uk-grid-match" uk-grid>
    <div class="uk-visible@m uk-width-1-5 '.$colorClassBorder.'">
        <div class="uk-padding-small">
        </div>
    </div>

    <div class="uk-width-expand@m">
        <div class="uk-padding npt npb npr">
            '.renderHeadline($page).'
            '. $out .'
        </div>
    </div>
</div>
';
//$out = renderContainer($page,$out,$containerClasses);
$out = renderSection($page,$out,$sectionClasses,array('skipDefaultClasses'=>false));
return $out;

Bewerberformular vorausfüllen mit verschiedenen Ansprechpartnern[Bearbeiten]

Das Formular soll versendet werden mit - Titel der Stellenanzeige (nicht veränderbar) - Name der Einrichtung (nicht veränderbar) - an verschiedene E-Mail Adressen, je nach Einrichtung für die die Stellenanzeige gilt.

ready.php

<?php namespace ProcessWire;

if(!defined("PROCESSWIRE")) die();

$emailList = array(
  'intensiv' => 'intensiv@sp-ps.de',
  'karlsruhe' => 'info@sp-ps.de',
  'rastatt' => 'oetigheim@sp-ps.de',
  'pforzheim' => 'info-pf@sp-ps.de',
  'rheinhausen' => 'info-oh@sp-ps.de',
  'tagespflege' => 'oetigheim@sp-ps.de',
);

// HOOKS FÜR BEWERBUNG IM JOBTEMPLATE
if($page->template->name=='job'){
  $formname = 'schnellkontakt';
  // E-Mails (Wert aus Template 'job' Feld: job_organizationname => Mailadresse)
  $organization = $page->job->job_organizationname->title;
  $organizationName = $page->job->job_organizationname->value;
  $jobtitle = $page->title;

  $wire->addHookBefore('FormBuilderProcessor::renderReady', 
    function($event) use($organization, $jobtitle, $formname) {
      
      $form = $event->arguments(0);
      if($form->name !== $formname) return;
      $form->getChildByName('ich_bewerbe_mich_fur_folgende_einrichtung')
        ->val($organization)
        ->attr('disabled', 'disabled'); 
      $form->getChildByName('ich_bewerbe_mich_als')
        ->val($jobtitle)
        ->attr('disabled', 'disabled');
    }
  ); 
  // nach dem übermitteln der eingaben (user kann nichts mehr ändern)
  $wire->addHook('FormBuilderProcessor::processInputDone', 
    function($event) use($organization, $jobtitle, $formname) {
      $form = $event->arguments(0);
      if($form->name !== $formname) return;
      $form->getChildByName('ich_bewerbe_mich_fur_folgende_einrichtung')->val($organization);
      $form->getChildByName('ich_bewerbe_mich_als')->val($jobtitle);  
    }
  ); 
  // change email based on job
  $wire->addHookBefore('FormBuilderProcessor::emailForm', 
    function($event) use($organizationName, $emailList, $formname) {
      $processor = $event->object;
      if($processor->formName != $formname) return; 
      if(array_key_exists($organizationName,$emailList)){
        $processor->emailTo = $emailList[$organizationName]; // tell FormBuilder to use that email
      }
    }
  );
}else{
  // HOOKS FÜR INITIATIVBEWERBUNG
  // change email based on job
  $wire->addHookBefore('FormBuilderProcessor::emailForm', 
    function($event) use($emailList) {
      $processor = $event->object;
      if($processor->formName != 'initiativbewerbung') return; 
      $form = $event->arguments(0);
      $name = $form->getChildByName('ich_bewerbe_mich_fur_folgende_einrichtung')->val();
      if(array_key_exists($name,$emailList)){
        $processor->emailTo = $emailList[$name]; // tell FormBuilder to use that email
      }
    }
  );
}

Funktionalität[Bearbeiten]

SchemaHelper[Bearbeiten]

Für Erzeugung der Strukturierten Daten

<?php namespace ProcessWire;
/**
 * SchemaHelper
 * Class for structured data
 * V1.0
 */
// @todo outsource some of the nessecary types (i.e. place) in backend use
// fieldgroups for that maybe s.th. like $place = getFg('schema_place')
class SchemaHelper{
	// Load the requested schema from the schemas directory and register the class
	public function jsonldJobPosting ($p) {
		$jsonld = array();
		$sanitizer = wire('sanitizer');
		//set unset fields (for not mandatory fields)
		$p->job->job_validthrough = $p->job->job_validthrough ? : ''; // todo test

		$jsonld["@context"] = "http://schema.org/";
		$jsonld["@type"] = "JobPosting";
		if($p->job->job_link) $jsonld["url"] = $p->job->job_link;
		else $jsonld["url"] = $sanitizer->url($p->httpUrl);
		$jsonld["datePosted"] = !empty($p->job->job_dateposted) ? date('Y-m-d', $p->job->getUnformatted('job_dateposted') ) : date('Y-m-d', strtotime($p->created));
		$jsonld["validThrough"] = date('Y-m-d', $p->job->getUnformatted('job_validthrough') );
		$jsonld["description"] = $sanitizer->textarea($p->job->job_description);
		$jsonld['hiringOrganization'] = array(
			"@type" => "Organization",
			"name" => $sanitizer->text($p->job->job_organizationname->title),
			"sameAs" => $sanitizer->url($p->job->job_link)
		);
		if($p->job->link2)$jsonld['hiringOrganization']['logo'] = $p->job->link2;
		$jsonld['title'] = $sanitizer->text($p->title);

		if($p->job->job_basesalary_minvalue && $p->job->job_basesalary_maxvalue && $p->job->job_basesalary_unittext){
			$jsonld['baseSalary'] = array(
				"@type" => "MonetaryAmount",
				"currency" => "EUR",
				"value" => array(
					"@type" => "QuantitativeValue",
					"minValue" => $sanitizer->float($p->job->job_basesalary_minvalue),
					"maxValue" => $sanitizer->float($p->job->job_basesalary_maxvalue),
					"unitText" => $sanitizer->text($p->job->job_basesalary_unittext->value)
				)
			);
		}else if($p->job->job_basesalary_minvalue && $p->job->job_basesalary_unittext){
			$jsonld['baseSalary'] = array(
				"@type" => "MonetaryAmount",
				"currency" => "EUR",
				"value" => array(
					"@type" => "QuantitativeValue",
					"value" => $sanitizer->float($p->job->job_basesalary_minvalue),
					"unitText" => $sanitizer->text($p->job->job_basesalary_unittext->value)
				)
			);
		}
		$jsonld['jobLocation'] = array(
			"@type" => "Place",
			"address" => array(
				"@type" => "PostalAddress",
				"streetAddress" => $sanitizer->text($p->job->job_streetaddress),
				"addressLocality" => $sanitizer->text($p->job->job_addresslocality),
				"addressRegion" => $sanitizer->text($p->job->job_addressregion),
				"postalCode" => $sanitizer->text($p->job->job_postalcode),
				"addressCountry" => $sanitizer->text($p->job->job_addresscountry),
			)
		);
		// recommended properties

		if($c = count($p->job->job_employmenttype)){
			$types = array();
			foreach($p->job->job_employmenttype as $type){
				$types[] = $sanitizer->text($type->value);
			}
			//var_dump($c);
			if($c > 1) $jsonld['employmentType'] = $types;
			else $jsonld['employmentType'] = $types[0];
		}

		//$out .= '<script type="application/ld+json">' . json_encode($jsonld) . '</script>';
		$out = '<script type="application/ld+json">' . json_encode($jsonld,JSON_PRETTY_PRINT) . '</script>';

		return $out;
	}

}