Projects
- CType
-
academicprojects_projectlist - Plugin
-
Academic, pluginProjects Project, actionList ProjectController:: list Action () - Set
-
fgtclb/, included inacademic- projects- project- list fgtclb/academic- projects - Templates
-
Templates/, with the partials belowProject/ List. html Partials/, see TemplatesProject/
The Projects element shows the project pages below the pages an editor chooses as cards: the project title, or the page title without one, linked to the project page, the short description, the categories of the project grouped by category type, and its first image. Above the cards the visitor finds a sorting, one select per category type and a select for the state of a project, and each change reloads the list with the new selection. A list that finds nothing says "No projects found."
It is the element for the overview page of the projects of a faculty, an institute or the whole institution. With the form hidden and the state preset to Active, it shows the running projects on a landing page. To show a few projects picked by hand, on the page of a research group for example, use Selected Projects, which has the same options.
The Projects element with its sorting, category and state selects and the project cards.
A project is a page of the page type Academic project. The list finds these pages, not records in a folder, and links every card to the page.
The element renders the template Project/ with the partials
below Project/, among them Sorting for the form
and Item. for a card. The project list and A project
show the markup, and Templates describes how to override the templates.
The list is rendered on every request rather than from the page cache, so the
selection of the visitor takes effect at once. A selection is part of the URL
and can be bookmarked or shared, see Feature: Project filter selections have a URL, and
Route enhancers turns it into a readable path. A sorting
or an active state the form does not offer, in the URL or in a submission, is
ignored, also a list of values where the form sends one. The default of the
extension applies in its place where the element shows that part of the form,
the preset of the element where it hides it.
Related chapters:
- The category filters describes the site settings that decide which category filters the form offers.
- Active filters, reset link and result count describes the active filter tags, the reset link and the number of projects found.
- The header of the content elements is for a site whose content element layout renders no header.
- Content Security Policy explains how the form works under the Content Security Policy of TYPO3.
Settings
The tab Configuration of the content element holds the options of the list and, below them, the field that chooses the pages.
-
- Type
- checkbox
- Default
- on
Shows the select Active state, with the options All, Active and Completed, in the form of the list. Switched off, the visitor cannot choose the state, and the list shows the state Active state presets.
The option stores the inverse,
settings., which is why it reads "show" while the stored value hides. A template override checkshide Active State {settings..hide Active State} With the select hidden, the list keeps the preset state when the visitor changes the sorting or a category, and whatever state the URL of a link carries. A list of running projects can therefore offer the category filter and still show only the running ones.
A Projects element preset to the running projects, with the whole form hidden. The element of the development instance shows hidden records, so the first card is the hidden project "Quantum curriculum study".
-
- Type
- select
- Default
- All
The state the list shows until the visitor picks another one: All projects, the Active ones or the Completed ones. The state of a project describes which projects count as which. An empty or unknown value counts as All, and so does a list of values, which TypoScript makes of the setting as soon as it has a child. The state an element stores does not replace such a list.
The list in the state Completed, with the tag that removes the state, the reset link and the number of projects found.
-
- Type
- checkbox
- Default
- on
Shows one select per category type in the form, as the site settings of The category filters decide. Switched off, the visitor cannot filter by category, and the list shows what Categories presets. The active filter tags of the categories are left out with the selects.
The option stores the inverse,
settings.. With the category selects hidden, the list keeps the preset categories when the visitor changes the sorting or the state. Categories in the URL of a link narrow the list further and never replace a preset category. Without preset categories, such a link filters the list as before.hide Filter
-
- Type
- checkbox
- Default
- on
Shows the two sorting selects, Sorting field and Sorting direction, in the form. Switched off, the list is sorted as Sorting says. With the sorting, the category filter and the state select all switched off, the element renders no form.
The option stores the inverse,
settings.. With the sorting selects hidden, the list keeps the sorting chosen here when the visitor changes a category or the state, and whatever sorting the URL of a link carries.hide Sorting
-
- Type
- select
- Default
- Title A-Z
The order of the list until the visitor picks another one:
- Title A-Z, Title Z-A: by the title of the page. The cards show the project title where there is one, so a list sorted by title is out of order where the two differ.
- Last updated (latest last), Last updated (latest first): by the date in the field Last Update of the page properties, which an editor sets by hand.
- Page sorting (Result may be unexpected), Page sorting, reversed (Result may be unexpected): by the position of each page among its sibling pages. That is the order of the page tree only while all project pages share one parent page.
- Budget (low to high), Budget (high to low): by the project budget.
- Start date (oldest first), Start date (newest first): by the project start.
Only the items of the select are supported. Any other value, an empty one, a field without a direction or a list of values for example, which the form never stores but an import or a TypoScript value for a content element without the field can produce, is ignored, and the list sorts by title, A to Z. TypoScript makes a list of the setting as soon as it has a child, such as
plugin., also next to a value of the setting itself, and the sorting an element stores does not replace such a list, so every list the TypoScript applies to then sorts by title, A to Z. Remove the child, or replace the whole setting by a single value, to get the sorting of the element back.tx_ academicprojects. settings. sorting. field
-
- Type
- category tree
- Default
- empty
Categories of the group
projectsthe list is filtered by until the visitor selects categories of their own. A project has to carry every category selected here, so two categories of the same type find only the projects that carry both. A project that carries only a subcategory of a selected category is not found. Select at most one category per category type unless that is meant.The tree shows every category of the installation that belongs to a type of the group
projects. While the category selects are shown, a selection the visitor submits replaces the categories chosen here of the category types the form offers, and the active filter tags show them as tags the visitor can remove. A category of a type the form does not offer, because The category filters leaves it out, stays. While the selects are hidden, the categories chosen here always apply.
-
- Type
- checkbox
- Default
- off
Shows on every card whether the project is active or completed, see The state on the project cards.
-
- Type
- page
- Default
- empty
The pages the project pages sit in. The list shows the project pages that are direct subpages of one of the chosen pages. Project pages further down the page tree are not found, so choose every page or folder that holds projects. The form offers no Recursive field for this element.
Empty, the list shows every project page of the installation, on every site. Only pages of the type Academic project are listed, whatever else lies below the chosen pages.
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 below the title:
<p class="ace-state completed">Completed</p>
A project card with its state below the title.
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.
Two lists on one page
All Projects elements of a page read the selection from the same URL arguments. A submission of the form is answered by the first of them on the page: it redirects to a URL that carries the selection as that element sees it, the presets it keeps included. For another Projects element of the page, a sorting or an active state the first element hides replaces the one its visitor chose. The preset categories of category selects the first element hides, and its preset categories of the category types its form does not offer, are added to the categories the visitor chose. Put lists whose forms hide or offer different parts on pages of their own.
Content Security Policy
The selects of the form submit it when the visitor changes one of them, through
the inline event handler
onchange="this.. A nonce does not
cover an event handler attribute, so the frontend policy of TYPO3 blocks it
once a site enforces that policy. The extension therefore allows exactly this
handler text in its Configuration/ContentSecurityPolicies.php, which
TYPO3 loads on its own: the directive script- of the frontend policy
gets 'unsafe- and
'sha256-. script- is not
changed. Every site that inherits the default frontend policy gets both
sources. A site whose csp. sets
inherit, and
a site package whose copy of Project/,
Project/ or Project/ uses another handler text, add the
hash of that text in the csp. of the site:
mutations:
- mode: extend
directive: 'script-src-attr'
sources:
- "'unsafe-hashes'"
- "'sha256-osjxnKEPL/pQJbFk1dKsF7PYFmTyMWGmVSiL9inhxJY='"
The hash is the base64 encoded SHA-256 of the handler text, without the quotes of the attribute. A policy the web server or a proxy sends is not covered and needs the same sources itself.
A site whose policy allows inline scripts already, with 'unsafe- in
script-, or in default- where it has no script-, gets no
script- from the extension: a listener of academic_base
takes it out again, unless the site declares the directive itself. The browser
then reads script- for the handlers of the form, as for the site's own
handlers. On a page whose script- keeps a nonce, a browser ignores
'unsafe- and blocks both.
For a visitor without JavaScript the form renders a submit button inside
<noscript>
, labelled
filter.. A visitor with JavaScript
does not see it.
Changed in version 2.4
The policy allows the handler, and the form renders the button.