mahu_frontend
TYPO3 extension The extension mahu_frontend
offers the site package and the search functionality for the Material Hub.
Features
- customized search functionality based on the find extension
- extends the User model by certain fields relevant for the Material Hub
- Sitemap data provider for Solr records
- a frontend editor for material descriptions (material edior)
- a frontend editor for supplemental data (supplement edior)
Development
All Material Hub extension are shipped with a grunt configuration (requires Node.js). This ensures that during development the files from /Resources/Private/Css and /Resources/Private/JavaScript are copied to /Resources/Public as soon as changes occur. For this purpose, the command grunt
must be executed in the root directory of the respective project via the console. Before committing to git, it is recommended to automatically generate a "production version" with the command grunt buildProd
, where minified files are stored in the /Resources/Public folder.
Usage
Dependencies
- find
- mahu_partners
- femanager
Setup
material search functionality
- Add the find plugin as a content element.
- Include the static TypoScript "Fluid content elements", "Fluid content elements CSS", "Find", "Mahu Frontend design templates".
- Configure the extension via TypoScript. A complete list of options can be found in the next section.
material editor functionality
- Add the plugin "mahufrontend_materialeditor" as a content element.
- Configure the extension via TypoScript. A complete list of options can be found in the next section.
supplement editor functionality
- Add the plugin "mahufrontend_supplementeditor" as a content element.
- Configure the extension via TypoScript. A complete list of options can be found in the next section.
TypoScript Configuration Options
To configure extension mahu_frontend
, the following settings are supported as part of the array plugin.tx_find.settings.mahu
of the TypoScript setup configuration.
dev
(boolean, default to 0): enable or disable the development mode (shows under construction indicator and debug area)imgRootPath
(defaults to /typo3conf/ext/mahu_frontend/Resources/Public/Images/):keepFacets
: determines whether set facets should be kept or reset when changing the free text queryPOST
: indicates whether the search form should use HTTP POST requests. If set to false or 0, GET requests are applied.autoEnableHistory
(boolean, defaults to false): if set to true/1, the history is enabled automatically. Otherwise it has to be activated later on, e.g. by a cookie consent management.partnerPageID
: ID of the company / institute search pageregulationsPageID
: ID of the regulation search pagecontactPageID
: ID of the contact pagematerialSearchPageID
: ID of the material search pagewizardPageID
: ID of the wizard page.addSupplements
: If true, supplemental data for a material description are queryied and shown on detail pages.showLogos
(defaults to true): Indicates whether logos of companies / institutes should be displayed in certain views.showSimilarMaterialsSearch
: Show or hide the similar materials search feature on detail pagesshowScores
(boolean, defaults to true): indicates whether score bars should be shownshowWelcomeDialog
: show or hide a welcome dialog to the usershowTeaser
: configures whether the teaser should be visible on the landing page. If true, the following setting is required:teaserCounts
: an array that holds metrics to be shown in the teasermaterials
(integer): number of materialscategories
(integer): number of categoriesusecases
(integer): number of usecases / application areascompanies
(integer): number of companies / institutesregulations
(integer): number of regulations
showNumberOfMaterialsInTaxonomy
: defines whether the number of materials per material class should be shown in the taxonomy widget on the landing pagedisableEmptyClassesInTaxonomy
: defines whether material classes without individuals should be disabled (e.g., be no clickable link) in the materials taxonomyfeedbackURL
: URL of the feedback questionairefeedbackURLQRCode
: URL of the QR code image that encodes thefeedbackURL
To configure extension mahu_frontend
, the following settings are supported as part of the array plugin.tx_mahufrontend.settings
of the TypoScript setup configuration.
materialEditorPageID
: ID of the site hosting the material editorsupplementEditorPageID
: ID of the site hosting the supplement editormaterialsOverviewPageID
: ID of the site containing the overview on materials and supplements
In addition, the extension supports the following constants:
useGenericQueryFields
(boolean): If false, traditional find query fields configuration takes place. If true, generic query fields are utilized for querying Solr. In addition, the material search frontend provides Requirement tags for users to specify their search criteria.
Furthermore, the extension relies on certain shared variables existing in the lib
data structure for a functioning base site / page setup (enabled by adding the static template).
- menus
lib.menu
: the header navigationlib.footerMenu
: link list in the footerlib.rootline
: the breadcrumb menulib.showRootline
(boolean): Enables or disables the breadcrumb menu.
- language settings
lib.currentLangID
: the ID of the current languagelib.currentLang
: the name/code if the current languagelib.showLanguageMenu
(boolean): enable or disable the language selection menu
- login/user settings
lib.loginEnabled
(boolean): indicates whether login mechanisms are in placelib.username
: a unique ID for the currently logged in user (e.g. propertyusername
)lib.usernameExt
: the display name of the currently logged in user (e.g. derived from propertiesfirst_name
andlast_name
)
- page IDs:
lib.landingPageID
: Id of the landing pagelib.profilePageID
: Id of the page for editing data provider profileslib.materialSearchPageID
: Id of the materials search pagelib.registrationPageID
: Id of the data provider registration pagelib.loginPageID
: Id of the page where data providers can loginlib.mahuLogoLinkPageID
: Id of the page to be linked by the Material Hub logo
lib.includeMatomo
(boolean): Controls whether the Javascript snipet for Matomo should be delivered to the client.lib.matomoURL
(string): The URL of the server hosting Matomolib.matomoSiteID
(string): The Matomo site ID to be tracked
Find related setup
As this extension is meant to be used in conjunction with the extension find, the find's configuration parameters related to the search functionality, like paging, sorting, and highlighting, take place. Please refer to the extension documentation.
However, a customized find verions is utilized in the Material Hub, offering some new features and the corresponding configuration parameters.
Grouping
plugin.tx_find.settings.grouping {
field = string // Solr field that serves for determining groups
limit = int // max. number of shown results per group (-1 for no limit)
showMenu = 0|1 // configures, whether the UI menu for selecting the number of results per page should be shown
menu { // an array that enumerates the options to be shown in the UI menu
0 = int
..
n = int
}
}
Highlighting
plugin.tx_find.settings.highlight {
method = unified // the Highlighter to be used, see https://lucene.apache.org/solr/guide/8_7/highlighting.html#choosing-a-highlighter
default {
fields { // Solr fields for that highlighting should be calculated
f1 = string
...
fn = string
}
}
}
XML Sitemap data provider for Solr
Besides the standard configuration parameters, this Sitemap data provider supports the following custom settings (config
array):
numberOfItemsPerPage
(integer, defaults to 100): defines the number of items that should appear in a sitemapmaxRows
(integer): sets the maximum numner of records to be queried from Solrconnection
: an array configuring the Solr connectionscheme
: the protocolhost
: the server name or IPport
: the portpath
: the URL pathtimeout
: maximum time in seconds to wait for a response before triggering a timeout
Example:
plugin.tx_seo.config {
xmlSitemap {
sitemaps {
materials {
provider = Slub\MahuFrontend\SolrRecordXmlSitemapDataProvider
config {
#numberOfItemsPerPage = 1000
maxRows = 1000
connection {
scheme = http
host = localhost
port = 8984
path = /solr/mahu/
timeout = 30
}
url {
pageId = 2
fieldToParameterMap {
id = tx_find_find[id]
}
additionalGetParameters {
tx_find_find.controller = Search
tx_find_find.action = detail
}
}
}
}