ProcessWire - Job Template: Unterschied zwischen den Versionen
Aus Wikizone
| Zeile 598: | Zeile 598: | ||
</pre> | </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. | ||
Version vom 14. März 2022, 13:38 Uhr
Beispiel Setting für Jobs mit strukturierten Daten
Beispiel von SPPS
Job Template
Felder
{
"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": []
}
}
}
Template Jobs
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
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 GESÜ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();
Funktionalität
SchemaHelper
Für Erzeugung der Strukturierten Daten