Overriding templates
EXT:academic_jobs is using Fluid as template engine.
This documentation won't bring you all information about Fluid but only the most important things you need for using it. You can get more information in the section Fluid templates of the Sitepackage tutorial. A complete reference of Fluid ViewHelpers provided by TYPO3 can be found in the ViewHelper Reference
Change the templates using TypoScript constants
As any Extbase based extension, you can find the templates in the directory
Resources/.
If you want to change a template, copy the desired files to the directory where you store the templates.
We suggest that you use a sitepackage extension. Learn how to Create a sitepackage extension.
# TypoScript constants
plugin.tx_academicjobs {
view {
templateRootPath = EXT:mysitepackage/Resources/Private/Extensions/myextension/Templates/
partialRootPath = EXT:mysitepackage/Resources/Private/Extensions/myextension/Partials/
layoutRootPath = EXT:mysitepackage/Resources/Private/Extensions/myextension/Layouts/
}
}
Change the labels of the job properties
The job list and the job detail view render the properties of a job through one
loop, in Resources/Private/Partials/Job/Item.html respectively
Resources/Private/Partials/Job/Information.html. The loop takes every
label from Resources/Private/Language/locallang.xlf, which follows three
rules:
jobs.<property>is the row label of a property, for examplejobs.orwork Location jobs..link jobs.<property>.<value>is the label of a value of a select property:jobs.totype. 1 jobs.andtype. 3 jobs.toemployment Type. 1 jobs..employment Type. 2 - Two properties are rendered without their stored value and therefore carry
a label that is a full statement:
jobs.andinternationals Welcome jobs.. They are rendered only when the flag is set.alumni Recommend
The link property is the one exception to the first rule: it renders the row
label jobs. and, as the text of the anchor, jobs..
Override any of them the way you override a label of an extension, without copying the partial:
# TypoScript setup
plugin.tx_academicjobs._LOCAL_LANG {
default.jobs.linkText = To the application form
de.jobs.linkText = Zum Bewerbungsformular
}
Every label of the extension, and the path of each content element, is listed in Labels.
Keep the confirmation in a copy of the form template
A visitor who returns to the form after a saved job, because no redirect page
is set, the redirect page is the page of the form or it cannot be linked, sees
the confirmation above the form. Templates/ renders it,
inside the element with the class academic-, from a queue of its own:
Templates/Job/New.html that renders the confirmation
<f:flashMessages queueIdentifier="academic_jobs.new_job_form.confirmation" />
A copy of the template in a site package takes this line over. Without it the confirmation waits in the session of the visitor, and the visitor sees the empty form. The form is not cached with the page, so the confirmation is shown once and to that visitor only.
Show the confirmation on a redirect page
The visitor who is sent to a redirect page gets the confirmation in the queue
of the plugin, extbase.. No shipped
template renders that queue, and the confirmation stays in the session of the
visitor until a page renders it. The form does not render it either, so it
never turns up there at a later visit.
To show it, render the queue on the redirect page, in a part of that page that
is not cached, for example with a
COA_ that renders a Fluid
template:
<f:flashMessages queueIdentifier="extbase.flashmessages.tx_academicjobs_newjobform" />
A site that shows a confirmation page of its own instead chooses never or Suppress when a redirect page is set for Flashmessage creation mode when persisting new jobs (FE), so no message waits in the session.