Skip to content
Snippets Groups Projects
ApplyFormSchema.html 1.48 KiB
Newer Older
{namespace h=SGalinski\SgJobs\ViewHelpers}

<f:alias map="{leftBrace: '{', rightBrace: '}'}">
	<script type="application/ld+json">
		{leftBrace}
			"@context": "https://schema.org/",
			"@type": "JobPosting",
			"title": "{job.title}",
			"description": "<f:format.htmlentities>{job.description}{job.task}{job.qualification}</f:format.htmlentities>",

			"employmentType": [
				<f:for each="{h:explodeString(string: '{job.employmentTypes}', delimiter: ',')}" as="employmentType" iteration="iterator">
					"{employmentType}"{f:if(condition: '{iterator.isLast} == FALSE', then: ',')}
				</f:for>
			],

			"datePosted": "{f:format.date(date: '{f:if(condition: job.datePosted, then: job.datePosted, else: \'now\')}', format: 'Y-m-d')}",
			<f:if condition="{job.validThrough}">
				"validThrough": "{f:format.date(date: job.validThrough, format: 'Y-m-d')}",
			</f:if>

			"hiringOrganization": {leftBrace}
				"@type": "Organization",
				"name": "{job.company.name}",
				"sameAs": "<f:uri.page pageUid="1" absolute="TRUE"/>",
				"logo": "<f:uri.image src="EXT:project_theme/Resources/Public/Images/logo-inverted.svg" absolute="TRUE"/>"
			{rightBrace},

			"jobLocation": {leftBrace}
				"@type": "Place",
				"address": {leftBrace}
					"@type": "PostalAddress",
					"streetAddress": "{job.company.street}",
					"addressLocality": "{job.company.city}",
					"postalCode": "{job.company.zip}",
					"addressCountry": "{job.company.country}"
				{rightBrace}
			{rightBrace}
		{rightBrace}
	</script>
</f:alias>