### TypoScript Configuration for DPN Glossary Extension Source: https://github.com/featdd/dpn_glossary/blob/master/Documentation/Configuration/ExampleTypoScriptSetup.rst This TypoScript configuration defines settings for the DPN Glossary extension, including pagination characters and term wrapping rules based on term type. It allows for custom display of terms with optional tooltips and links. ```typoscript plugin.tx_dpnglossary { settings { pagination { characters = A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z insertAbove = 1 insertBelow = 0 } termWraps = CASE termWraps { key.field = term_type default = TEXT default { field = name dataWrap = | typolink { ATagParams.dataWrap = title="{field:tooltiptext}" class="dpnglossary link" ATagParams.dataWrap { override = title="{field:name}" class="dpnglossary link" override.if.isFalse.data = field:tooltiptext } useCacheHash = 1 } } abbreviation { dataWrap = | dataWrap { override = | override.if.isFalse.data = field:tooltiptext } } acronym { dataWrap = | dataWrap { override = | override.if.isFalse.data = field:tooltiptext } } definition { dataWrap = | dataWrap { override = | override.if.isFalse.data = field:tooltiptext } } } } } ``` -------------------------------- ### PHP Example for Programmatic DPN Glossary Term Creation Source: https://context7.com/featdd/dpn_glossary/llms.txt Demonstrates how to create a new glossary term, add synonyms and descriptions, and persist it using TYPO3's domain model and repository pattern. Requires `GeneralUtility`, `Term`, `Synonym`, `Description` classes, and a `TermRepository` instance. ```php setPid(123); // Storage page UID $term->setName('Application Programming Interface'); $term->setUrlSegment('api'); $term->setTooltiptext('A set of protocols for building software'); $term->setTermType('abbreviation'); $term->setTermLang('en'); $term->setMaxReplacements(3); $term->setSeoTitle('API - Application Programming Interface'); $term->setMetaDescription('Learn about APIs and how they enable software communication.'); // Add synonym $synonym = GeneralUtility::makeInstance(Synonym::class); $synonym->setName('API'); $term->addSynonym($synonym); // Add description $description = GeneralUtility::makeInstance(Description::class); $description->setMeaning('General'); $description->setText('

An API is a set of rules that allows programs to communicate with each other.

'); $term->addDescription($description); // Persist $termRepository->add($term); $persistenceManager->persistAll(); ``` -------------------------------- ### DPN Glossary Term Repository Methods (PHP) Source: https://context7.com/featdd/dpn_glossary/llms.txt Showcases the DPN Glossary TermRepository for retrieving terms with custom ordering and filtering. Includes examples for finding all terms, newest, random, by UIDs, and by name length. Dependencies include `Featdd\DpnGlossary\Domain\Repository\TermRepository` and `TYPO3\CMS\Extbase\Persistence\QueryResultInterface`. ```php termRepository = $termRepository; } public function featuredTermsAction(): ResponseInterface { // Find all terms (default ordering: name ASC) $allTerms = $this->termRepository->findAll(); // Find newest terms (ordered by creation date DESC) $newestTerms = $this->termRepository->findNewest(10); // Returns: QueryResultInterface with 10 newest terms // Find random terms (shuffled) $randomTerms = $this->termRepository->findRandom(5); // Returns: array with 5 random terms // Find terms by UIDs $selectedTerms = $this->termRepository->findByUids([123, 456, 789]); // Returns: QueryResultInterface with terms matching UIDs // Find terms sorted by length (used internally by parser) $termsByLength = $this->termRepository->findByNameLength(); // Returns: array sorted by name length DESC (longest first) // Example: ["Search Engine Optimization", "Application", "API", "JS"] $this->view->assignMultiple([ 'allTerms' => $allTerms, 'newestTerms' => $newestTerms, 'randomTerms' => $randomTerms, 'selectedTerms' => $selectedTerms, ]); return $this->htmlResponse(); } } // Example: Create custom repository extending base functionality namespace Vendor\Extension\Domain\Repository; use Featdd\DpnGlossary\Domain\Repository\TermRepository as BaseTermRepository; class CustomTermRepository extends BaseTermRepository { public function findByCategory(string $category): QueryResultInterface { $query = $this->createQuery(); $query->matching( $query->equals('customCategory', $category) ); return $query->execute(); } public function findPopular(int $limit = 10): QueryResultInterface { // Assuming you added a 'views' field $query = $this->createQuery(); $query->setOrderings(['views' => 'DESC']); $query->setLimit($limit); return $query->execute(); } } ``` -------------------------------- ### TYPO3 Routing Configuration for Glossary Terms Source: https://context7.com/featdd/dpn_glossary/llms.txt YAML configuration for TYPO3's routing system to create SEO-friendly URLs for glossary terms, including support for character-based pagination. This setup enhances discoverability and user experience. ```yaml ``` -------------------------------- ### GET /glossary/{term} Source: https://context7.com/featdd/dpn_glossary/llms.txt Displays detailed information for a single term, including SEO metadata, descriptions, synonyms, and media. The page title and meta description are automatically set based on the term's data. ```APIDOC ## GET /glossary/{term} ### Description Displays detailed information for a single term, including SEO metadata, descriptions, synonyms, and media. The page title and meta description are automatically set based on the term's data. ### Method GET ### Endpoint /glossary/{term} ### Parameters #### Path Parameters - **term** (string) - Required - The identifier or name of the term to display. ### Request Example Not applicable for GET request. ### Response #### Success Response (200) - **term** (object) - Contains detailed information about the term, including: - **name** (string) - The name of the term. - **tooltiptext** (string) - A short tooltip description for the term. - **synonyms** (array) - A list of synonyms for the term. - **descriptions** (array) - A list of detailed descriptions for the term. - **media** (array) - A list of media associated with the term. - **seoTitle** (string) - The SEO-optimized title for the term. - **metaDescription** (string) - The meta description for the term. #### Response Example ```json { "term": { "name": "Search Engine Optimization", "tooltiptext": "The process of improving a website's visibility in search engine results.", "synonyms": [ { "name": "SEO" } ], "descriptions": [ { "meaning": "Definition", "text": "SEO is the practice of increasing the quantity and quality of traffic to your website through organic search engine results." } ], "media": [ { "type": "image", "url": "/fileadmin/images/seo_image.png", "alternative": "SEO illustration" } ], "seoTitle": "Search Engine Optimization (SEO) Guide", "metaDescription": "Learn the fundamentals of Search Engine Optimization (SEO) to improve your website's search rankings." } } ``` ``` -------------------------------- ### Fluid Template for Term Detail Page Source: https://context7.com/featdd/dpn_glossary/llms.txt An example Fluid template (Show.html) for rendering the term detail page. It displays the term name, short description (tooltiptext), synonyms, detailed descriptions, and associated media. The template utilizes Fluid's f:if, f:for, and f:format.html ViewHelpers for conditional rendering and HTML formatting, and a custom dpnglossary:backlink ViewHelper. ```html

{term.name}

{term.tooltiptext}

Also known as: {synonym.name} ,

{description.meaning}

{description.text -> f:format.html()}
Back to glossary
``` -------------------------------- ### Implement Cache Management for Glossary Terms (PHP) Source: https://context7.com/featdd/dpn_glossary/llms.txt Configures and demonstrates manual cache operations for glossary terms to optimize performance. It shows how to define a cache configuration, use the CacheManager to get a cache instance, and perform flush and set operations with identifiers and tags. Caching is automatically handled by hooks for data modifications. ```php \TYPO3\CMS\Core\Cache\Frontend\VariableFrontend::class, 'backend' => \TYPO3\CMS\Core\Cache\Backend\Db::class, 'options' => [ 'defaultLifetime' => 0, // Unlimited lifetime ], ]; // Cache is used in ParserService constructor: // Cache identifier: sha1('termsByNameLength_' . $languageId . '_' . implode(',', $storagePids)) // Cache tags: ['storage-123', 'storage-456', 'language-0'] // Example: Manual cache operations use TYPO3\CMS\Core\Cache\CacheManager; use TYPO3\CMS\Core\Utility\GeneralUtility; $cacheManager = GeneralUtility::makeInstance(CacheManager::class); $cache = $cacheManager->getCache('dpnglossary_termscache'); // Clear all term cache $cache->flush(); // Clear cache for specific storage page (e.g., after editing terms) $cache->flushByTag('storage-123'); // Clear cache for specific language $cache->flushByTag('language-1'); // Get cached terms manually $cacheIdentifier = sha1('termsByNameLength_0_123,456'); $cachedTerms = $cache->get($cacheIdentifier); if ($cachedTerms === false) { // Cache miss - load from database $terms = $termRepository->findByNameLength(); $cache->set($cacheIdentifier, $terms, ['storage-123', 'storage-456', 'language-0']); } // Cache is automatically cleared when: // 1. A term is edited/created/deleted (via DataHandlerClearCachePostProcHook) // 2. Storage page is cleared in backend // 3. "Clear all cache" is triggered ?> ``` -------------------------------- ### Fluid Template for Breadcrumb Navigation Source: https://context7.com/featdd/dpn_glossary/llms.txt A Fluid template designed to render breadcrumb navigation. It iterates through a 'breadcrumb' data structure, displaying each item as a list item with appropriate links and active/current states. Includes an example output. ```html ``` -------------------------------- ### Configure XML Sitemap for Glossary Terms (TypoScript) Source: https://github.com/featdd/dpn_glossary/blob/master/Documentation/Configuration/CreateXmlSitemapForTerms.rst This TypoScript configuration defines how the TYPO3 SEO extension generates an XML sitemap for glossary terms. It specifies the data provider, the database table containing the terms, sorting and modification fields, and how to construct the URLs for each term, including page IDs and GET parameters. ```typoscript plugin.tx_seo.config { xmlSitemap { sitemaps { glossar { provider = TYPO3\CMS\Seo\XmlSitemap\RecordsXmlSitemapDataProvider config { table = tx_dpnglossary_domain_model_term sortField = name lastModifiedField = tstamp pid = 123 #uid of the sysfolder where your term are stored url { pageId = 456 #uid of the page where the glossary plugin is placed fieldToParameterMap { uid = tx_dpnglossary_glossary[term] } additionalGetParameters { tx_dpnglossary_glossary.controller = Term tx_dpnglossary_glossary.action = show } useCacheHash = 1 } } } } } } ``` -------------------------------- ### DPN Glossary TypoScript Example: Customizing Term Wraps Source: https://github.com/featdd/dpn_glossary/blob/master/Documentation/Configuration/Reference.rst This TypoScript snippet demonstrates how to customize the term wrapping behavior in the DPN Glossary extension. It shows how to set specific attributes for anchor tags (`ATagParams`), including linking to the term's description as the title and applying a CSS class. ```typoscript plugin.tx_dpnglossary.settings { termWraps { default.typolink.ATagParams.dataWrap = title="{field:descriptions|0|meaning}" class="dpnglossary link" } } ``` -------------------------------- ### HTML Structure for Dynamic Content Exclusion Source: https://github.com/featdd/dpn_glossary/blob/master/Documentation/Configuration/ExcludeContentFromParser.rst An example of an HTML structure that can dynamically add an exclusion class for the DPN Glossary parser. This leverages Fluid templating to conditionally apply the exclusion based on content element properties. ```html
``` -------------------------------- ### Customize Term Rendering with Typoscript Source: https://context7.com/featdd/dpn_glossary/llms.txt Provides various Typoscript examples to customize how glossary terms are displayed on the frontend. Options include wrapping terms in spans for tooltips, using mark tags for highlighting, applying different styles based on term type (technical, business, acronym), and adding custom data attributes for JavaScript interactions. ```typoscript # Example 1: Tooltip with modal popup instead of link plugin.tx_dpnglossary.settings.termWraps.default = TEXT plugin.tx_dpnglossary.settings.termWraps.default { field = parsing_name dataWrap = | } # Example 2: Highlight terms without linking plugin.tx_dpnglossary.settings.termWraps.default = TEXT plugin.tx_dpnglossary.settings.termWraps.default { field = parsing_name wrap = | } # Example 3: Different rendering based on term type plugin.tx_dpnglossary.settings.termWraps = CASE plugin.tx_dpnglossary.settings.termWraps { key.field = term_type # Technical terms: code styling technical = TEXT technical { field = parsing_name wrap = | } # Business terms: link to detail page business < .default # Acronyms: show full text in tooltip acronym = TEXT acronym { field = parsing_name dataWrap = | } } # Example 4: Add data attributes for JavaScript interaction plugin.tx_dpnglossary.settings.termWraps.default = TEXT plugin.tx_dpnglossary.settings.termWraps.default { field = parsing_name typolink { parameter = {field:url_segment} parameter.insertData = 1 ATagParams.dataWrap ( class="glossary-link" data-term-id="{field:uid}" data-term-type="{field:term_type}" data-term-tooltip="{field:tooltiptext}" data-term-url="{field:url_segment}" ) } } ``` -------------------------------- ### TYPO3 DpnGlossary Basic Configuration Source: https://context7.com/featdd/dpn_glossary/llms.txt Sets up the basic persistence and settings for the DpnGlossary extension. This includes the storage page ID for terms, the detail page UID, and initial parser configurations such as pages to parse and exclude. ```typoscript plugin.tx_dpnglossary { persistence { storagePid = 123 # Page ID where terms are stored } settings { # Detail page configuration detailPage = 456 # Page UID for term detail view # Parser settings parsingPids = 0 # Pages to parse (0 = all pages, comma-separated list for specific pages) parsingExcludePidList = 10,20,30 # Pages to exclude from parsing parsingTags = p,div,li,td,span # HTML tags whose content will be parsed forbiddenParentTags = a,script,h1,h2,h3 # Tags not allowed as parent of parsed content forbiddenParsingTagClasses = no-glossary,exclude-terms # CSS classes to exclude forbiddenParentClasses = tx_dpn_glossary_exclude # Classes on ancestors to exclude # Replacement limits maxReplacementPerPage = 5 # Max replacements per term per page (-1 = unlimited) maxReplacementPerPageRespectSynonyms = 1 # Count synonyms toward limit # Synonym parsing parseSynonyms = 1 # Enable synonym parsing priorisedSynonymParsing = 1 # Parse synonyms before main term name # Performance useCachingFramework = 1 # Use cache for term loading parserRepositoryClass = Featdd\DpnGlossary\Domain\Repository\ParserTermRepository # Advanced parser options limitParsingId = main-content # Restrict parsing to DOM element with this ID parsingSpecialWrapCharacters = # Additional regex boundary characters excludeTermLinksTargetPages = 1 # Don't link term if target page is current page # Display modes listmode = pagination # normal, character, or pagination previewlimit = 5 # Number of terms in preview plugins # Character sets for grouping/pagination pagination.characters = A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,0-9 groupedListCharacters < .pagination.characters # Term wrapping configuration (how terms are rendered) termWraps = CASE termWraps { key.field = term_type # Default: creates link to detail page default = TEXT default { field = parsing_name typolink { parameter = #{field:url_segment} parameter { insertData = 1 # Use external link if term_mode = 'link' override = {field:term_link} override { insertData = 1 if { value = link equals.field = term_mode } } # Use detail page if set stdWrap.override < plugin.tx_dpnglossary.settings.detailPage } # Add parameters for TYPO3 routing additionalParams = &tx_dpnglossary_glossary[controller]=Term&tx_dpnglossary_glossary[action]=show&tx_dpnglossary_glossary[term]={field:uid} additionalParams.insertData = 1 # Add title and CSS class ATagParams.dataWrap = title="{field:tooltiptext}" class="dpnglossary link" } } # Abbreviation: wraps in tag abbreviation < .default abbreviation { dataWrap = | } # Acronym: wraps in tag acronym < .default acronym { dataWrap = | } # Definition: wraps in tag definition < .default definition { dataWrap = | } } } } ``` -------------------------------- ### Configure Fluid template rendering for dpn_glossary (TypoScript) Source: https://github.com/featdd/dpn_glossary/blob/master/Documentation/Configuration/RenderTermsWithFluidTemplate.rst This TypoScript configuration enables Fluid template rendering for dpn_glossary terms. It specifies template paths, sets up data processing using `DatabaseQueryProcessor` to fetch page information, and assumes a Fluid template named 'TermWraps/Default'. ```typoscript plugin.tx_dpnglossary.settings { termWraps { default > default = FLUIDTEMPLATE default { stdWrap.trim = 1 templateRootPaths { 10 = EXT:your_site_package/Resources/Private/Templates/ } templateName = TermWraps/Default settings < plugin.tx_dpnglossary.settings dataProcessing { 10 = TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor 10 { table = pages pidInList = 0 uidInList = this as = currentPage } } } } } ``` -------------------------------- ### Fluid template for dpn_glossary term link (HTML) Source: https://github.com/featdd/dpn_glossary/blob/master/Documentation/Configuration/RenderTermsWithFluidTemplate.rst This Fluid template defines how a dpn_glossary term is displayed as a link. It uses the `` ViewHelper to create a link to the term's detail page and displays the term's name. The `` ViewHelper is used to remove unnecessary whitespace. ```html {data.name} ``` -------------------------------- ### DPN Glossary Preview Plugins Configuration (TypoScript) Source: https://context7.com/featdd/dpn_glossary/llms.txt Details the configuration of four built-in DPN Glossary plugins for displaying subsets of terms. This includes setting the list mode for a full glossary with pagination, and configuring preview limits for newest, random, and selected terms by UID. ```typoscript # Plugin 1: Full glossary list with pagination # Insert content element "Glossary" in backend # tt_content.CType = dpnglossary_glossary plugin.tx_dpnglossary.settings.listmode = pagination # Plugin 2: Preview newest terms # Insert content element "Glossary Preview Newest" in backend # tt_content.CType = dpnglossary_glossarypreviewnewest plugin.tx_dpnglossary.settings.previewlimit = 5 # Plugin 3: Preview random terms # Insert content element "Glossary Preview Random" in backend # tt_content.CType = dpnglossary_glossarypreviewrandom plugin.tx_dpnglossary.settings.previewlimit = 8 # Plugin 4: Preview selected terms by UID # Insert content element "Glossary Preview Selected" in backend ``` -------------------------------- ### DPN Glossary Preview Widgets and Custom Templates Source: https://context7.com/featdd/dpn_glossary/llms.txt Demonstrates how to use Fluid templates for displaying glossary previews, including a default template for selected terms and a custom template for random or limited previews. Requires the 'terms' variable and 'settings.detailPage' for linking. ```html

Latest Additions

  • {term.name} {term.tooltiptext}
{settings.previewlimit: 3, settings.previewmode: 'random'} ``` -------------------------------- ### Display Term Detail Page in PHP Source: https://context7.com/featdd/dpn_glossary/llms.txt The showAction method in TermController displays detailed information for a single term. It includes validation to ensure the term is in configured storage, automatically sets SEO page titles and meta descriptions, and assigns the term to the view for rendering. Dependencies include Term model, ResponseInterface, and various utility classes for exceptions and meta tag management. ```php getPid(), $this->storagePids, true)) { throw new ImmediateResponseException( GeneralUtility::makeInstance(ErrorController::class) ->pageNotFoundAction($this->request, 'Term not found') ); } // Page title automatically set via TermPageTitleProvider: // - Uses $term->getSeoTitle() if set // - Falls back to $term->getName() // Meta description set if configured: if ($this->settings['setMetaDescription'] ?? false) { if ($term->getMetaDescription()) { GeneralUtility::makeInstance(MetaTagManagerRegistry::class) ->getManagerForProperty('description') ->addProperty('description', $term->getMetaDescription()); } } $this->view->assign('term', $term); return $this->htmlResponse(); } ``` -------------------------------- ### DpnGlossary Routing Configuration (YAML) Source: https://github.com/featdd/dpn_glossary/blob/master/Documentation/Configuration/ConfigureRoutingForTermsAndPagination.rst YAML configuration for DpnGlossary routes, defining paths for term listing and individual term display, including arguments and default controllers. It specifies aspects for URL segment mapping and character range matching with special characters. ```yaml DpnGlossary: type: Extbase limitToPages: [YOUR_PLUGINPAGE_UID] extension: DpnGlossary plugin: glossary routes: - routePath: '/{character}' _controller: 'Term::list' _arguments: character: currentCharacter - routePath: '/{localized_term}/{term_name}' _controller: 'Term::show' _arguments: term_name: term defaultController: 'Term::list' defaults: character: '' aspects: term_name: type: PersistedAliasMapper tableName: 'tx_dpnglossary_domain_model_term' routeFieldName: 'url_segment' character: type: StaticMultiRangeMapper ranges: - start: 'A' end: 'Z' special: [ Ä,Ö,Ü ] localized_term: type: LocaleModifier default: 'term' localeMap: - locale: 'de_DE.*' value: 'begriff' ``` -------------------------------- ### SQL Database Schema for DPN Glossary Term Storage Source: https://context7.com/featdd/dpn_glossary/llms.txt Defines the SQL structure for the main term table (tx_dpnglossary_domain_model_term), synonym table (tx_dpnglossary_domain_model_synonym), and description table (tx_dpnglossary_domain_model_description). Includes fields for term details, relations, parsing configuration, SEO, and TYPO3 standard fields. Also includes ALTER statements to extend the 'pages' and 'tt_content' tables. ```sql -- Main term table CREATE TABLE tx_dpnglossary_domain_model_term ( uid int(11) NOT NULL auto_increment, pid int(11) DEFAULT '0' NOT NULL, -- Core fields name varchar(255) DEFAULT '' NOT NULL, url_segment varchar(255) DEFAULT '' NOT NULL, tooltiptext varchar(255) DEFAULT '' NOT NULL, -- Term configuration term_type varchar(255) DEFAULT '' NOT NULL, -- 'definition', 'abbreviation', 'acronym', or custom term_lang char(2) DEFAULT '' NOT NULL, -- ISO 639-1 language code term_mode varchar(255) DEFAULT '' NOT NULL, -- 'link' for external links, empty for normal term_link varchar(255) DEFAULT '' NOT NULL, -- External URL if term_mode = 'link' -- Parsing configuration exclude_from_parsing tinyint(1) DEFAULT '0' NOT NULL, case_sensitive tinyint(1) DEFAULT '0' NOT NULL, max_replacements int(11) DEFAULT '-1' NOT NULL, -- -1 = unlimited -- SEO fields seo_title varchar(255) DEFAULT '' NOT NULL, meta_description text, -- Relations descriptions int(11) unsigned DEFAULT '0' NOT NULL, -- tx_dpnglossary_domain_model_description synonyms int(11) unsigned DEFAULT '0' NOT NULL, -- tx_dpnglossary_domain_model_synonym media int(11) unsigned DEFAULT '0' NOT NULL, -- sys_file_reference -- TYPO3 standard fields sys_language_uid int(11) DEFAULT '0' NOT NULL, l10n_parent int(11) DEFAULT '0' NOT NULL, hidden tinyint(1) DEFAULT '0' NOT NULL, deleted tinyint(1) DEFAULT '0' NOT NULL, starttime int(11) unsigned DEFAULT '0' NOT NULL, endtime int(11) unsigned DEFAULT '0' NOT NULL, crdate int(11) unsigned DEFAULT '0' NOT NULL, tstamp int(11) unsigned DEFAULT '0' NOT NULL, PRIMARY KEY (uid), KEY parent (pid), KEY language (l10n_parent,sys_language_uid) ); -- Synonym table CREATE TABLE tx_dpnglossary_domain_model_synonym ( uid int(11) NOT NULL auto_increment, pid int(11) DEFAULT '0' NOT NULL, term int(11) unsigned DEFAULT '0' NOT NULL, name varchar(255) DEFAULT '' NOT NULL, PRIMARY KEY (uid), KEY parent (pid), KEY term (term) ); -- Description table (multiple descriptions per term) CREATE TABLE tx_dpnglossary_domain_model_description ( uid int(11) NOT NULL auto_increment, pid int(11) DEFAULT '0' NOT NULL, term int(11) unsigned DEFAULT '0' NOT NULL, meaning varchar(255) DEFAULT '' NOT NULL, -- Short identifier for this meaning text text, -- Full description with HTML PRIMARY KEY (uid), KEY parent (pid), KEY term (term) ); -- Extended page table (disable parser per page) ALTER TABLE pages ADD tx_dpnglossary_disable_parser tinyint(1) DEFAULT '0' NOT NULL; -- Extended content table (disable parser per content element) ALTER TABLE tt_content ADD tx_dpnglossary_disable_parser tinyint(1) DEFAULT '0' NOT NULL; ``` -------------------------------- ### TypoScript Configuration Source: https://context7.com/featdd/dpn_glossary/llms.txt Provides TypoScript configuration settings for controlling the Dpn Glossary parser's behavior, term wrapping, and display modes. ```APIDOC ## TypoScript Configuration ### Description Provides TypoScript configuration settings for controlling the Dpn Glossary parser's behavior, term wrapping, and display modes. ### Method Configuration (TypoScript) ### Endpoint N/A ### Parameters N/A ### Request Example Not applicable. ### Response N/A ### TypoScript Example ```typoscript plugin.tx_dpn_glossary { view { templateRootPaths.0 = EXT:dpn_glossary/Resources/Private/Templates/ partialRootPaths.0 = EXT:dpn_glossary/Resources/Private/Partials/ layoutRootPaths.0 = EXT:dpn_glossary/Resources/Private/Layouts/ } persistence { storagePid = 123 # Example storage PID } settings { setMetaDescription = 1 # Enable meta description termWrapper = | # Example term wrapper displayMode = full # Example display mode } } ``` ``` -------------------------------- ### TypoScript Configuration for Parser Settings Source: https://context7.com/featdd/dpn_glossary/llms.txt This snippet represents TypoScript configuration used to control the behavior of a parser within the DPN Glossary project. It typically includes settings for term wrapping, display modes, and other parser-specific options, allowing for flexible customization of how terms are processed and displayed. ```typoscript config.tx_dpn_glossary { parser { wrapTerms = 1 termDelimiter = "*" displayMode = "short" // Add other parser-specific settings here } // Other configurations like storagePids, etc. } ``` -------------------------------- ### Configure DPN Glossary Route Enhancers (YAML) Source: https://context7.com/featdd/dpn_glossary/llms.txt Defines URL structures for glossary detail and list pages using TYPO3's Extbase route enhancers. It maps URL segments to controller actions and arguments, utilizing aspects for dynamic routing, such as persisted aliases for term slugs and static multi-range mappers for character-based lists. ```yaml routeEnhancers: DpnGlossary: type: Extbase limitToPages: - 456 # Glossary detail page UID extension: DpnGlossary plugin: Glossary routes: - routePath: '/{term_slug}' _controller: 'Term::show' _arguments: term_slug: term defaultController: 'Term::show' aspects: term_slug: type: PersistedAliasMapper tableName: tx_dpnglossary_domain_model_term routeFieldName: url_segment routeValuePrefix: '' DpnGlossaryList: type: Extbase limitToPages: - 455 # Glossary list page UID extension: DpnGlossary plugin: Glossary routes: - routePath: '/character/{character}' _controller: 'Term::list' _arguments: character: currentCharacter defaultController: 'Term::list' aspects: character: type: StaticMultiRangeMapper # Custom aspect from extension ranges: - start: 'A' end: 'Z' - start: '0' end: '9' ``` -------------------------------- ### DPN Glossary TypoScript Settings Overview Source: https://github.com/featdd/dpn_glossary/blob/master/Documentation/Configuration/Reference.rst This section outlines various TypoScript constants available for configuring the DPN Glossary extension. These settings control aspects like detail page IDs, parsing scope, replacement limits, display modes, and parser behavior. Some settings allow for advanced configuration, such as specifying custom repository classes or overriding default content layouts. ```typoscript settings.detailPage settings.parsingPids settings.parsingExcludePidList settings.maxReplacementPerPage settings.maxReplacementPerPageRespectSynonyms settings.limitParsingId settings.parsingTags settings.forbiddenParentTags settings.forbiddenParsingTagClasses settings.forbiddenParentClasses settings.listmode settings.previewmode settings.previewlimit settings.disableParser settings.parseSynonyms settings.priorisedSynonymParsing settings.parsingSpecialWrapCharacters settings.parserRepositoryClass settings.overrideFluidStyledContentLayout settings.excludeTermLinksTargetPages ``` -------------------------------- ### Display Glossary Terms with List Modes (PHP) Source: https://context7.com/featdd/dpn_glossary/llms.txt This PHP controller action retrieves all glossary terms and displays them based on a 'listmode' setting. It supports normal lists, character-grouped lists, and paginated views, utilizing custom alphabets and handling non-ASCII characters through helper methods. ```php settings['listmode'] ?? 'normal'; // 'normal', 'character', 'pagination' $terms = $this->termRepository->findAll(); switch ($listMode) { case 'character': // Groups terms by first character: ['A' => [terms], 'B' => [terms], ...] $characters = explode(',', $this->settings['groupedListCharacters'] ?? 'A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z'); $groupedTerms = ObjectUtility::groupObjectsByFirstCharacter( $terms, 'name', $characters, '_' // fallback for special characters ); $this->view->assign('groupedTerms', $groupedTerms); break; case 'pagination': // Paginated view with character filter $characters = explode(',', $this->settings['pagination']['characters']); $paginator = new CharacterPaginator($terms, 'name', $currentCharacter, ...$characters); $pagination = new CharacterPagination($paginator, ...$characters); $this->view->assignMultiple([ 'pagination' => $pagination, 'terms' => $paginator->getPaginatedItems(), 'currentCharacter' => $paginator->getCurrentCharacter(), ]); break; default: $this->view->assign('terms', $terms); } return $this->htmlResponse(); } } // TypoScript configuration for list modes: // plugin.tx_dpnglossary.settings { // listmode = pagination // pagination.characters = A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,0-9 // groupedListCharacters = A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,0-9 // } // Fluid template example (List.html): // // // //
//

{term.name}

// //

{description.text -> f:format.html()}

//
//
//
//
``` -------------------------------- ### AddTermToMenuProcessor for Breadcrumb Integration (TypoScript) Source: https://context7.com/featdd/dpn_glossary/llms.txt Configures TypoScript to use the AddTermToMenuProcessor for integrating the current glossary term into breadcrumb navigation and main menus. It leverages MenuProcessor for existing menus and dynamically adds the term if present in the URL parameters. ```typoscript # Add term to breadcrumb navigation lib.breadcrumb = FLUIDTEMPLATE lib.breadcrumb { file = EXT:site/Resources/Private/Templates/Breadcrumb.html dataProcessing { 10 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor 10 { special = rootline special.range = 0|-1 as = breadcrumb } # Add current term to breadcrumb 20 = Featdd\DpnGlossary\DataProcessing\AddTermToMenuProcessor 20 { menus = breadcrumb # Will check for tx_dpnglossary_glossary[term] parameter # If present, loads term and appends to menu with: # - title = term name # - link = current page URL # - active = 1 # - current = 1 } } } # Add term to main menu page.10 = FLUIDTEMPLATE page.10 { dataProcessing { 10 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor 10 { levels = 2 as = mainMenu } 20 = Featdd\DpnGlossary\DataProcessing\AddTermToMenuProcessor 20.menus = mainMenu } } ``` -------------------------------- ### ParserService::pageParser - Automatic Term Linking Source: https://context7.com/featdd/dpn_glossary/llms.txt The core parsing engine that scans HTML content and replaces term occurrences with interactive elements. It traverses the DOM tree, applies regex matching with configurable boundaries, and respects replacement limits per term. The parser protects scripts and links from manipulation, handles case-insensitive matching with umlaut support, and excludes forbidden parent tags. ```APIDOC ## POST /api/parse-content ### Description Processes HTML content to automatically detect and link glossary terms. This service loads terms from cache, protects scripts and comments, traverses the DOM, matches terms using regex, wraps matches with configured TypoScript, and manages replacement limits. ### Method POST ### Endpoint /api/parse-content ### Parameters #### Query Parameters - **html** (string) - Required - The HTML content to be parsed. #### Request Body This endpoint does not require a request body, but the `html` parameter should be passed as a query parameter. ### Request Example ```html GET /api/parse-content?html=

Search Engine Optimization improves website visibility. SEO is essential.

``` ### Response #### Success Response (200) - **parsedHtml** (string) - The HTML content with glossary terms automatically linked and transformed. #### Response Example ```json { "parsedHtml": "

Search Engine Optimization improves website visibility. SEO is essential.

" } ``` ``` -------------------------------- ### TYPO3 DpnGlossary Custom Term Wrapping Source: https://context7.com/featdd/dpn_glossary/llms.txt Defines a custom way to wrap glossary terms, using a span element with specific data attributes for tooltips and term IDs, instead of a direct link to the detail page. ```typoscript # Custom term wrapping example (tooltip instead of link) plugin.tx_dpnglossary.settings.termWraps.default = TEXT plugin.tx_dpnglossary.settings.termWraps.default { field = parsing_name dataWrap = | } ```