Configuration
This extension ships its frontend TypoScript and its backend page TSconfig in two forms: as TYPO3 site sets, and as classic static templates plus page TSconfig files that are selected on a page. Both forms read the very same files, so they configure an installation identically.
Pick one of them per site and stay with it — see Do not combine both for what happens otherwise.
What the sets contain
This extension ships two content elements, so it ships two component sets and one aggregate set that depends on all of them.
Both content elements are driven by one Extbase plugin, so they share one
TypoScript block,
plugin.. That block is
shipped once, in Configuration/, and every component includes
it. Which component sets a site names therefore decides which content elements
the backend offers, not how much TypoScript is loaded.
| Set | Delivers |
|---|---|
fgtclb/ | The Projects content element. |
fgtclb/ | The Selected Projects content element. |
fgtclb/ | Everything above. This is the set to use unless you deliberately want a subset, and it is the name this extension published before the sets were cut per component — a site configuration that depends on it needs no change. |
Every content element set depends on fgtclb/, the set
of EXT:academic_base that labels the content element group all
academic extensions sort their elements into.
What the sets do not control
The page type Academic project (doktype 30) and its backend layout AcademicProject are not part of any set, and enabling or not enabling a set never changes them.
That is deliberate, not an oversight. Both are values stored on
pages
records: a page carries doktype = 30 and backend_
long before any site configuration is read. Were they delivered by an opt-in
set, every page tree on a site that does not use that set would show
[ MISSING LABEL ] for the layout, the layout could not be picked for
a new page, and the page type would disappear from the page tree wizard.
They are therefore registered installation-wide — the page type in TCA
(Configuration/TCA/Overrides/pages.php), the backend layout in the
always-included Configuration/page.tsconfig — and stay available on every
site of the installation.
What a set does deliver for that page type is its frontend rendering: the
page
object that picks the Fluid template of the page type is part
of the shared TypoScript block, so a site that includes no set of this extension
renders such a page with whatever its own site package defines.
The content of a project page
A project page renders the content elements of its main column
(
col) below the project data, in their manual order and in
the language of the page. Any set of this extension, or the static template of
the shared block, delivers that, and no other set is needed for it.
The content is the variable
project of the page object,
defined inside the condition on the project page type, so it exists on project
pages only. It is a
CONTENT
object that renders the records
through the
tt_ object of the site, and it works for a
FLUIDTEMPLATE
and a
PAGEVIEW
page object alike.
To render another column, or to slide the content from the parent pages, change the variable inside the same condition:
[page && traverse(page, "doktype") == 30]
page.10.variables.projectContent {
select.where = {#colPos}=1
}
[END]
A page template of your own renders it as
{project.
Changed in version 3.0
Up to 2.x the page template rendered the global object
styles., which only the set
fgtclb/ defined for the whole site. The set
and its static template are removed, see
Breaking: Project pages render their content without a global path.
Note
The page type renders the short description and the funders of a project,
and the project list its short description, through
<f: and therefore through the site's
lib.. TYPO3 defines that path for every site, so
it needs no configuration; a site that refines it changes how links, allowed
tags and paragraphs of these fields are rendered, exactly as for every other
rich text field.
The layout of a project page
A project page renders inside the page layout of the site package, the way the
other pages of the site do: the page template declares a layout and fills its
section
Main
. The layout is Default unless a setting names
another one, which is what
bk2k/bootstrap-package
and most site
packages provide.
| Site setting / constant | Default | Meaning |
|---|---|---|
plugin. | Default | The Fluid layout of the site package the project page renders its
section
Main
into. An empty value is read as Default. |
It is a site setting of the aggregate set fgtclb/, and a
constant of the same name for a site on the static templates. A site that
depends on a component set alone gets the default, but the site settings editor
does not offer the setting there. Depend on the aggregate set to configure it.
The page template reaches it as the variable
project of
the page object, so it works on a
FLUIDTEMPLATE
and a
PAGEVIEW
page object alike.
A site package without a layout Default gets the fallback layout of this
extension, which renders the section
Main
and nothing else: the page
renders without the header, navigation and footer of the site, as it did up to
2.x, rather than failing. A layout Default of the site package wins over
it. The fallback exists for Default only: a layout the setting names
has to exist in the site package, or the project page fails as any page with a
missing Fluid layout does.
The parts of a project page
The section
Main
renders five partials, each of which can be replaced
on its own:
| Partial | Renders |
|---|---|
Project/ | The project title, or the title of the page without one, the
subtitle of the page and the short description, in one element
<header class="ace-. |
Project/ | The first image of the page, through the shared image partial of EXT:academic_base. |
Project/ | The categories assigned to the page, grouped by category type. |
Project/ | The runtime, the budget and the funders of the project. |
Project/ | The content elements, the variable
project
described above. |
Every partial receives all variables of the page:
{project}
,
{images}
,
{project,
{page and those of the
site package's page object.
{page is the record of the page on
both page object types,
{data}
of a
FLUIDTEMPLATE
page
object and
{page. of a
PAGEVIEW
one. The
subtitle is its field
{page.
The templates and partials of the page type are registered at the key 50 of
the page object. Register a directory of your own with a higher key, and its
files win:
# FLUIDTEMPLATE: a directory holding Project/Page/Header.html
page.10.partialRootPaths.75 = EXT:my_sitepackage/Resources/Private/Partials/
# PAGEVIEW: a directory holding Partials/Project/Page/Header.html
page.10.paths.75 = EXT:my_sitepackage/Resources/Private/
A site package that registers its own paths above 50 needs no line at all -
a
PAGEVIEW
site package at
paths., for example:
a Partials/ of its own wins already. An override of
the whole Pages/ keeps working the same way, and
renders without a layout, as before.
Changed in version 3.0
Up to 2.x the page template declared no layout and rendered every part
inline, and its paths used the key 100. See
Breaking: Project pages render inside the site layout.
Include the site set
Add the set to the config. of the site that should offer the content
elements:
base: 'https://example.com/'
rootPageId: 1
+dependencies:
+ - fgtclb/academic-projects
See also TYPO3 Explained, Using a site set as dependency in a site.
Include static templates
For an installation that still configures its frontend through
sys_ records, the same files are registered as static templates
and as selectable page TSconfig files.
Tip
On TYPO3 v13 and v14 we recommend the site set — and if you use it, do not
press the backend button Create a root TypoScript record on that
site. The
sys_ record it creates carries the flag
Clear for constants and setup, and that flag discards everything
the site sets contributed. An installation that is already in that state
gets its configuration back by selecting the static templates below in that
very record.
Include static TypoScript
Edit the
sys_ record of the site root and add the entry to
Include static (from extensions):
| Entry | Delivers |
|---|---|
| Academic Projects: Projects (academic_projects) | The TypoScript of the Projects content element. |
| Academic Projects: Projects (selected) (academic_projects) | The same for Selected Projects. |
| Academic Projects: All components (academic_projects) | Every component this extension ships, in one entry. |
| Academic Projects: Shared plugin settings and page rendering (academic_projects) | The shared
plugin. block and the
page
object of the page type, on their own. This is
the entry an installation stored before the configuration was cut
per component, and it keeps working — but it does not make any
content element selectable, which the page TSconfig below does. |
Include static page TSconfig
Edit the page record of the site root, tab Resources, field Page TSconfig, and add the entry:
| Entry | Delivers |
|---|---|
| Academic Projects: Projects (academic_projects) | Makes the Projects content element selectable, and configures its entry in the new content element wizard. |
| Academic Projects: Projects (selected) (academic_projects) | The same for Selected Projects. |
| Academic Projects: All components (academic_projects) | Every component this extension ships, in one entry. |
The setting is inherited by every page below the one it is set on.
The category filters
The filter form of the Projects and the
Selected Projects content elements offers one select per category
type of the group projects. Three settings change which of them it offers and
how, for the whole site:
| Site setting and constant | Default | Meaning |
|---|---|---|
plugin. | empty | The category types to offer, in this order, as a comma separated
list of type identifiers, for example
project_. Empty offers every type
that has a category, in the order of the category types of the
group. |
plugin. | 0 | How many filters the form shows right away. The others follow in a More filters section the visitor opens, which is open already while one of its filters has a value. 0 shows every filter. |
plugin. | 0 | Leaves out a category no listed project carries, instead of offering it as a disabled option. A selected category is always offered. A filter whose categories are all left out still renders, with its "All" option only. |
plugin:
tx_academicprojects:
filter:
categoryTypes: 'project_department,competence_field'
visibleCount: 1
hideDisabledOptions: true
The settings are site settings of the aggregate set fgtclb/
and constants of the same names for a site on static templates. A site that
depends on one of the component sets alone gets the defaults, but the site
settings editor does not offer the settings there — both content elements read
them, and a set declares settings only for itself.
A type is offered only when at least one category of that type exists, and an identifier that is no type of the group is ignored. The settings decide what the form offers, not what the list accepts: a link that filters by a category of a type the form does not offer still filters the list.
The "All" option of a filter
The first option of each filter, the one that selects no category, reads the
label
sys_ of this extension, and
falls back to
sys_ ("All options") where a
type has none. The extension ships no label per type; a site adds them in
TypoScript, for every content element of the extension or for one plugin:
plugin.tx_academicprojects._LOCAL_LANG {
default.sys_category.projects.allOptions.competence_field = All competence fields
de.sys_category.projects.allOptions.competence_field = Alle Kompetenzfelder
}
# Only in the Projects content element:
plugin.tx_academicprojects_projectlist._LOCAL_LANG.default.sys_category.projects.allOptions.competence_field = All competence fields
A language file override works as well, as for any label of this extension:
$GLOBALS on TYPO3 v13,
$GLOBALS on TYPO3 v14,
each pointing from
EXT:academic_projects/Resources/Private/Language/locallang.xlf to a file
of the site package.
Templates
The partial Project/ renders the selects from the
variable
{filter:
{filter and
{filter hold the identifiers of the offered types, in their
order, before and behind More filters. Where that variable does not
reach the partial, in a template that renders the partial with arguments of its
own instead of
{_, it offers every type with a category, as before,
and the filter types and the visible count have no effect there. To use them,
pass
filter on in a template that renders the partial.
New in version 2.4
Up to 2.3 the form offered every type with a category, all of them right away and with one "All" label, and anything else needed an override of the partial.
Active filters, reset link and result count
Three switches add to the filter form of the Projects and Selected Projects content elements, for the whole site. All three are off by default.
| Site setting and constant | Default | Meaning |
|---|---|---|
plugin. | 0 | One tag per selected category and one for an active state other than "All", below the form. Each tag links to the list without that selection, every other selection and the sorting kept. The state tag links to the state "All". |
plugin. | 0 | A Reset all filters link to the page without any list argument, so the list shows what the content element presets. Offered after the visitor selected something, while a category or an active state other than "All" is selected or preset by the content element, also once the visitor removed the preset. On the page as the editor preset it, the link would lead to the page shown. |
plugin. | 0 | The number of projects found, for example "12 projects found". |
plugin:
tx_academicprojects:
filter:
showActiveFilters: true
showReset: true
showResultCount: true
The settings are site settings of the aggregate set fgtclb/ and constants of
the same names, like the filter settings above.
- A tag shows a category in the language of the page.
- A tag stays a tag when the editor preset its category or state: removing it shows the list without it, and the reset link brings the preset back.
- The category tags are shown only while the category filter is, and the state tag only while the state select is: a tag removes what the visitor could change. Where the content element hides both, neither tags nor the reset link are shown. The count is.
- Every selected category is a tag, also one whose type the form does not offer (see the filter types above), for example a preset one. Removing it works like for any other tag.
- The tags and the reset link come from the partial
Project/, the count fromActive Filters. html Project/. Both are rendered byResult Count. html Project/, so a project that overrides that partial does not show them until it renders them as well. The partials use the classesSorting And Filters. html ace-on the list of tags,active- filters ace-on a tag,active- filter ace-on the links andlink ace-on the count, and bring no styles.count - The reset link needs the variable
{visitor, which the list action assigns. A template that renders the partials with arguments of its own has to pass it on, or the list offers no reset link.Selection} - The labels are
filter.,active Filters. label filter.,active Filters. remove filter.,reset list.andresult Count. singular list.of this extension. The count labels take the number asresult Count. plural %d, the remove label the category title as%s.
New in version 3.0
The three settings and the two partials.
The state of a project
A project is active while it has no end date or its end date is still ahead,
and completed once its end date has passed. The Active state
filter of the project lists selects by that rule, and a template reads the same
state from every project as
{project.: active or
completed, never empty.
A project page whose end date was never stored has no end date either, and is active. That is a page created in the page tree, a page switched to the project page type, an imported page or one from before the extension was installed, as long as no editor has entered an end date. The Active filter lists it, and the Completed filter does not.
The state on the project cards
The option Show active state badge of the Projects and
the Selected Projects content elements shows the state on every
project card, with the labels
active and
active of this extension. It is off by default, and a
content element saved before the option existed stays without the badge.
The partial Project/ renders it above the title:
<p class="ace-state completed">Completed</p>
An active project gets
active
instead. That class names the state in
every language, so a site styles the two states by it. A
site package with a Project/ of its own shows the badge only
once it takes over that block.
The crop variants of the project page media
The image cropper of the media of a project page offers three crop variants. A
template requests one by its name, through the crop argument of
<f: or of the image partial of EXT:academic_base:
| Name | Aspect ratio |
|---|---|
default | Free, 16:9, 3:2, 4:3 and 1:1 |
landscape | 16:9 |
portrait | 3:4 |
default is the variant TYPO3 offers when a file field configures none, with
the same ratios, and the templates of this extension render it. A crop an editor
stored before the update is stored under that name and keeps its meaning.
The variants belong to the project page type. The media of a standard page keeps what TYPO3 offers.
An image stores a crop for the new variants once an editor opens it in the
backend form and saves the record. Until then a template that requests
landscape or portrait renders the image uncropped. Where the image already
has a crop for default, the cropper starts landscape from that crop, fitted
into its ratio, and portrait from the whole image, fitted and centred; an
image without a crop starts both from the whole image.
A site that does not want a variant disables it in TCA, on this field only. The extension configures the variants in its own TCA overrides, so the site package has to depend on academic_projects for its line to load later:
$GLOBALS['TCA']['pages']['types'][30]['columnsOverrides']['media']['config']['overrideChildTca']['columns']['crop']['config']['cropVariants']['portrait']['disabled'] = true;
Page TSconfig is not the way to do that.
TCEFORM. reaches every image below
the page it is set on, and on an image field that configures no variants of its
own it leaves the cropper with no variant at all, not even default.
A project that defines crop variants of its own for the project page media does so at the same path. A variant it sets by name replaces the one of the same name and leaves the others; assigning the whole array replaces all of them.
Crop variants a project configures on the media field of every page, or on
sys_ for every image, are merged with these on the project page:
the values of this extension win key by key, and a ratio the project adds to a
variant of the same name stays. A project that restricted default to a fixed
ratio that way therefore finds all the ratios of the TYPO3 default offered on
project pages again, and the free ratio preselected on an image without a crop.
The header of the content elements
The header and the subheader an editor enters on a Projects or Selected Projects content element are rendered by the content element layout of the site, as for any other content element. The layouts of EXT:fluid_styled_content and of the bootstrap package do that, and the plugins render no header of their own.
A site whose content element layout renders no header, because its element templates render it instead, lets the plugins render it:
plugin.tx_academicprojects.renderContentElementHeader = 1
On a site that uses the site set, that is the site setting Project
lists | Render the content element header of fgtclb/. The
templates then render the header partial of EXT:fluid_styled_content
above their output, for every header layout except Hidden. Do not
switch it on where the layout renders the header: the header then appears twice.
The extension does not require EXT:fluid_styled_content. It adds the
partial path of that extension below every other one, so a site package that
ships a Header/ of its own renders that one instead, and a site
without EXT:fluid_styled_content provides the partial that way.
For the header layout Default, the partial takes the heading level
from
plugin., which
is mapped from the constant
styles. of
EXT:fluid_styled_content. A site that does not include the
TypoScript of EXT:fluid_styled_content sets the setting itself;
without it, such a header renders as an empty
<header>
element.
Do not combine both
A site that uses the site set and the static template reads the shipped
files twice. The site set is applied before the
sys_ record, so
the second read happens after the site settings and after
config/ — and it resets every constant
the extension ships a default for back to that default. For this extension that
is the
plugin. constants block: the three Fluid
root paths, the settings of the category filters and the content element header switch.
Nothing else is damaged: the Constants and Setup fields
of the
sys_ record, the page TSconfig of a page and the page
TSconfig files selected on a page are all applied afterwards and still win. Use
one mechanism per site and the question does not arise.
Search, permissions and the wizard
The Integration chapter of academic_base covers what an installation runs beside the academic extensions: an index queue for project pages with EXT:solr, the tables, fields and content types an editor group needs as a preset for b13/permission-sets, and how to move, rename or order the academic content elements in the new content element wizard.