A TYPO3 extension for a glossary and a contentparser to link terms to a detailpage.
Links:
- Simple configuration
- Automatic parsing of terms
Glossary extension for TYPO3
Home Page: http://typo3.org/extensions/repository/view/dpn_glossary
License: GNU General Public License v2.0
A TYPO3 extension for a glossary and a contentparser to link terms to a detailpage.
Links:
RealUrl Config has to be updated but the widget parameter doesn't fit in the current config.
If the list and detail action will be separated on different pages RealUrl can be configured and page translations also can be handled again as in earlier versions.
Hey @featdd,
First off thank you for the fix on the custom templates! Just downloaded the new version and works like a charm! I hope I'm not too annoying but I have one final question, more realURL related.
Currently I have the following part in my realurlconf setup:
'fixedPostVars' => array(
'dpn_glossary_Glossarylist' . '_list_RealUrlConfig' => array(
array(
'GETvar' => 'tx_dpnglossary_glossarylist[controller]',
'noMatch' => 'bypass'
),
array(
'GETvar' => 'tx_dpnglossary_glossarylist[action]',
'noMatch' => 'bypass'
),
array(
'GETvar' => 'tx_dpnglossary_glossarylist[@widget_0][character]',
),
),
'dpn_glossary_Glossarydetail' . '_detail_RealUrlConfig' => array(
array(
'GETvar' => 'tx_dpnglossary_glossarydetail[controller]',
'noMatch' => 'bypass'
),
array(
'GETvar' => 'tx_dpnglossary_glossarydetail[action]',
'noMatch' => 'bypass'
),
array(
'GETvar' => 'tx_dpnglossary_glossarydetail[term]',
'lookUpTable' => array(
'table' => 'tx_dpnglossary_domain_model_term',
'id_field' => 'uid',
'alias_field' => 'name',
'addWhereClause' => ' AND NOT deleted',
'useUniqueCache' => 1,
'useUniqueCache_conf' => array(
'strtolower' => 1,
'spaceCharacter' => '-'
),
'languageGetVar' => 'L',
'languageExceptionUids' => '',
'languageField' => 'sys_language_uid',
'transOrigPointerField' => 'l10n_parent',
'autoUpdate' => 1,
'expireDays' => 180
),
),
array(
'GETvar' => 'tx_dpnglossary_glossarydetail[pageUid]'
),
),
'6' => 'dpn_glossary_list_RealUrlConfig',
'16' => 'dpn_glossary_detail_RealUrlConfig',
),
This works like it should and gives me a nice SEO friendly URL:
http://www.domain.com/glossary/detail/item-name/
Because I removed the "detail" name from the breadcrumbs, and detail as a page does not really exist. (Visiting http://www.domain.com/glossary/detail/
gets you nowhere) I would also like to remove this part from the URL.
Do you have an idea how this could be done? I've tried checking "Exclude from speaking URL" on the detail page but that doesn't seem to do anything in this case ...
If a term like acronyms have multiple definitions, then let the user choice by context which definition he wants to see
Hi Daniel, thank you for your work!
I use 2.5.1 with TYPO3 7.6.10
In the BE, field synonym is required, so i must fill it with some thing. Why?
Did I miss something?
Metin
Hi,
Typo3 7.6.4,
dpn_glossary 2.3.15
Term: GmbH
Text Example: <br>Foo GmbH<br>
The Text in my Example is not replaced by the parser unless i add a space between the term and the tag (<br>Foo GmbH <br>
).
Thx
Update documentation and examples
Can you explain what exactly the WrapperService
does?
If I include your provided static TS-Template and request any page where the plug-in is not in the content, I get the following error:
PHP Fatal error: Using $this when not in object context in /typo3/typo3conf/ext/dpn_glossary/Classes/Service/WrapperService.php on line 302
I resolved the issue by disabling the Tags:
plugin.tx_dpnglossary.settings.parsingTags =
FYI:
TYPO 6.2.14
dpn_glossary 2.3.4 (GitHub Version)
PHP 5.3.29 (I know... but there is some very old code :/)
P.S. On the development system with the same configuration (without the dirty fix) everything works fine
Hi,
I am trying to have the Glossary extension show the name in the breadcrumbs on the detail page.
I currently have this code:
[globalVar = GP:tx_dpnglossary_glossarydetail > 0]
lib.breadcrumbs.10.1.NO.doNotLinkIt = 0
lib.breadcrumbs.10.1.NO.stdWrap.crop = 50 | …
lib.breadcrumbs.20 = RECORDS
lib.breadcrumbs.20 {
dontCheckPid = 1
tables = tx_dpnglossary_domain_model_term
source.data = GP:tx_dpnglossary_domain_model_term|name
source.intval = 1
conf.tx_dpnglossary_domain_model_term = TEXT
conf.tx_dpnglossary_domain_model_term.field = name
conf.tx_dpnglossary_domain_model_term.htmlSpecialChars = 1
wrap = <li><span>|</span></li>
stdWrap.crop = 50 | …
}
[global]
It works so far that I'm getting the wrap shown, but it's empty. I couldn't find anything in the docs.
Any idea what I'm doing wrong?
The synonyms could be shown in the list and linked to the original term.
Status of entry in list determinable by property like
<f:if condition="{term.issynonym}">
<img src="arrow.png" />
</f:if>
When trying to get to detail list over a linked term you get to the list action,
or the listpage goes to detailpage of a term.
Make the terms descriptions sortable
Hi, are there plans to implement the parsing of alternate terms for an entry? In some languages (e.g. German) there exist many synonyms and adjectives.
Hi Daniel,
will the ext. support higher php versions in the near future. Unluckily I installed your extension and I got white front and backend. Ofcourse I had a backup to do a quick rollback via shell :-)
Using $query->statement seems to level out the default query settings. Why not completely use the query builder?
The issue is that the respectStoragePid is not taken into account as it is.
Hello,
i have since version 2.3.16 a composer error:
Installing typo3-ter/dpn-glossary (2.3.18)
Downloading: 100%
[ErrorException]
Undefined index: conflicts
With the version 2.3.16 work the composer update.
To make the maxReplacementsPerPage work across multiple DOM Elements the terms should be iterated by reference:
ParserService.php
line 218:
foreach ($this->terms as &$term) {
line 251:
$callback = function($match) use (&$term) {
Some entries should be limited to specific fe-users.
Is it possible to add a short description or teaser text below the term in list mode?
The short text could be cropped from the description text.
Hi Daniel,
i tryed with 2 different installations on 7.6.11 and dpn_glossary 2.5.4:
in constants i try to exclude my detailpage from parsing:
plugin.tx_dpnglossary.settings.parsingExcludePidList = 31
But it dos'nt work. The terms on detailpage (from the field descriptions) are linked again.
in my realurl config, i have:
'fixedPostVars' =>
array (
'30' => 'dpn_glossary_list_RealUrlConfig',
'31' => 'dpn_glossary_detail_RealUrlConfig',
),
link in the listpage: .../ext-testbereich/dpn-glossary/detail/begriff1/
link in the detailpage: .../ext-testbereich/dpn-glossary/detail/begriff1/31/
and if i click this link from the detailpage, i stay on the same page, but the backlink is changing. If i click the new backlink, a error occurs:
{"exception":"exception 'TYPO3\CMS\Extbase\Mvc\Controller\Exception\RequiredArgumentMissingException' with message 'Required argument "term" is not set for Featdd\DpnGlossary\Controller\TermController->show.'
Thanks for your help!
Example: Include script resource with a conditional comment:
page.includeJS {
html5 = EXT:myextension/Resources/Public/js/html5.js
html5.allWrap = <!--[if lt IE 9]>|<![endif]-->
}
HTML-Output with disableParser = 1:
<!--[if lt IE 9]><script src="/typo3conf/ext/myextension/Resources/Public/js/html5.js?1394455858" type="text/javascript"></script><![endif]-->
HTML-Output with disableParser = 0 (the <![endif]--> part is now missing):
<!--[if lt IE 9]><script src="/typo3conf/ext/myextension/Resources/Public/js/html5.js?1394455858" type="text/javascript"></script>
I think the problem starts with ParserUtility::protectInlineJSFromDOM($GLOBALS['TSFE']->content). After this function the html looks like this (include line breaks for better reading):
<!--[if lt IE 9]>
<!--DPNGLOSSARY<script src="/typo3conf/ext/myextension/Resources/Public/js/html5.js?1394455858" type="text/javascript"></script>-->
<![endif]-->
This is invalid html because of a comment block inside a comment block.
Hello Daniel,
at first: thanx for creating an extbase glossary extension.
But I've spent some time with a simple change of typoscript - but nothing did work. Then, I've recognized that abbreviation has to be "abbrevation" ...
Well, perhaps it is no easy to change cause it breaks existing installations: the field term_type is filled with "abbrevation", not with an index number.
But anyways, I'd think it should be corrected, don't you?
Best regards,
Falko
Implement updatescript that transforms descriptionfields into description objects and assign them to the terms
example class: https://github.com/FluidTYPO3/flux/blob/development/class.ext_update.php
Links to an entry detail page from the list page generate urls like domain.tld/list/myterm/. Parsed terms on content pages generate ulrs like domain.tld/list/myterm/123. The number matches the page id of the referring page.
Since the second url does not have the canonical meta tag set to the first one, this is potentially duplicate content.
TYPO3 7.6.4, PHP 7.0.4, dpn_glossary 2.3.19, metaseo 2.0.0
Setting MaxReplacementsPerPage seems to limit the replacement of a term with each DOM elemet defined by the html tag. By default this is the p-tag.
Since every page has usually more than one p-tag the setting has almost no effect. There is still a good chance that one term will be replaced multiple times on one page.
Since the parser iterates first over the DOM elements and then within each DOM element over the list of terms it might be tricky to decide if a term has been replaced within a previous DOM element.
Possible solution would be a change in the textParser() function:
Check if there are matches for a term, then make the replacements with the selected limit (maxReplacementsPerPage) and after that unset the term from $this->term. This would avoid further replacements. Should I write a patch for this?
Also, parsingTags is set to p by default. Is there any other tag that would make sense here?
I'm using Typo3 version 7.1
Yesterday I did a update of this extension to latest TER version (2.2.6)
In the backend everything is okay, but no front ent page gets rendered any more. In apache logfile I can see the following:
[Tue Jun 23 18:25:56.872659 2015] [:error] [pid 13373] [client <IP:Address>:53396] PHP Catchable fatal error: Argument 1 passed to TYPO3\\CMS\\Core\\Utility\\GeneralUtility::removeDotsFromTS() must be of the type array, null given, called in /srv/www/typo3/htdocs/typo3conf/ext/dpn_glossary/Classes/Service/WrapperService.php on line 103 and defined in /srv/www/typo3/typo3_src-7.1.0/typo3/sysext/core/Classes/Utility/GeneralUtility.php on line 1730
Make the terms tooltip field optional
A character pagination for the term listing
Hi @featdd,
I'm trying to set custom template paths so I don't have to edit the original template files. But no matter what I try the plugin only reads the original path.
What I've tried:
Still the module only grabs the original files. Tested on 2 separate installations because I think I might be going crazy. Could it be that these paths are accidentally hardcoded somewhere in the plugin? (Also grabbed the latest version from GitHub, did not solve the problem).
Kind regards,
Erik
I'm using TYPO3 CMS 7.2.0 and dpn_glossary 2.2.4, with a (apart from Flux and Fluidcontent being installed) otherwise vanilla site.
When I navigate to a page that contains a word that matches a glossary term, the page does not load, but times out after the maximum execution time is reached, with the following stacktrace:
Fatal error: Maximum execution time of 600 seconds exceeded in /var/www/vhosts/intranet/data/typo3conf/ext/dpn_glossary/Classes/Service/WrapperService.php on line 145
Call Stack:
0.0005 233632 1. {main}() /home/typo3/typo3_src/typo3_src-7.2.0/index.php:0
0.0254 1452016 2. TYPO3\CMS\Core\Core\Bootstrap->run() /home/typo3/typo3_src/typo3_src-7.2.0/index.php:33
0.0818 2956776 3. TYPO3\CMS\Frontend\RequestHandler->handleRequest() /home/typo3/typo3_src/typo3_src-7.2.0/typo3/sysext/core/Classes/Core/Bootstrap.php:191
0.8549 17282480 4. TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController->generatePage_postProcessing() /home/typo3/typo3_src/typo3_src-7.2.0/typo3/sysext/frontend/Classes/RequestHandler.php:214
0.8549 17282832 5. TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction() /home/typo3/typo3_src/typo3_src-7.2.0/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php:3337
0.8557 17289992 6. call_user_func_array:{/home/typo3/typo3_src/typo3_src-7.2.0/typo3/sysext/core/Classes/Utility/GeneralUtility.php:4155}() /home/typo3/typo3_src/typo3_src-7.2.0/typo3/sysext/core/Classes/Utility/GeneralUtility.php:4155
0.8557 17291424 7. DPN\DpnGlossary\Service\WrapperService->contentParser() /home/typo3/typo3_src/typo3_src-7.2.0/typo3/sysext/core/Classes/Utility/GeneralUtility.php:4155
601.1411 21096992 8. DOMNode->getNodePath() /var/www/vhosts/intranet/data/typo3conf/ext/dpn_glossary/Classes/Service/WrapperService.php:145
This also happens when the term is not inside a Fluidcontent element but a regular CSC element.
Thanks in advance.
the whole parser can be moved out of the typo3 context, so it will be easier to use it in non TYPO3 projects.
Hi,
is it possible to have a paginated list on the same page as the detail view?
I need it like this: clickable characters on top as tabs, below on the left a navigation with all the terms starting with the current char and on the right the detail view of the current term.
A [B] C D ... -------------------------------------- B term 1 | Description B term 2 [B term 2] | B term 3 | ...
I've already tried to use the list mode pagination for both the tabs on top and the navigation on the left, setting display: none to the terms above and the chars below, but the problem is that if a term is clicked both navs jump back to A. So how can I keep the highlighted char B on top and the terms starting with B on the left while displaying the B term details on the right?
Is it possible to add the currently selected char to the detail view URL?
Change the image field in the term to a media field, so adding videos etc. can be possible
Please complement the functionality to give selectors like classes or ids to include/exclude parts for parsing.
I have e.g. div#footer, where text elements are places, which should not beeing parsed.
Now every term which is founded will be rendered to a link this may could not be wanted in some situations.
check everything for cgl and correctness of settings in TYPO3 files
I have an extension that renders some inline JavaScript. That includes some HTML inside strings.
My constants configuration is as follows:
plugin.tx_dpnglossary.persistence.storagePid = 12
plugin.tx_dpnglossary.settings.parsingTags = p,span,h1,h2,h3,h4,h5,h6
plugin.tx_dpnglossary.settings.forbiddenParentTags = script,a
plugin.tx_dpnglossary.settings.listPage = 13
plugin.tx_dpnglossary.settings.detailPage = 14
Inline JavaScript example (output with dpn_glossary
deactivated):
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery(".fancybox-9")
.attr('rel', 'gallery-9')
.fancybox({
tpl: {
closeBtn : '<a title="Close" class="fancybox-item fancybox-close" href="javascript:;"></a>',
next : '<a title="Next image" class="fancybox-nav fancybox-next" href="javascript:;"><span></span></a>',
prev : '<a title="Previous Image" class="fancybox-nav fancybox-prev" href="javascript:;"><span></span></a>'
},
openEffect : 'elastic',
openSpeed : 150,
closeEffect : 'elastic',
closeSpeed : 150,
closeClick : true,
playSpeed: 3000,
beforeShow: function () {},
afterShow: function() {
overlay : null
},
helpers : {
buttons : {
position: 'top',
tpl : '<div id="fancybox-buttons"><ul><li><a class="btnPrev" title="Previous Image" href="javascript:;"></a></li><li><a class="btnPlay" title="Start Slideshow" href="javascript:;"></a></li><li><a class="btnNext" title="Next image" href="javascript:;"></a></li><li><a class="btnToggle" title="toggle Size" href="javascript:;"></a></li><li><a class="btnClose" title="Close" href="javascript:;"></a></li></ul></div>'
},
title : {
type: 'inside'
}
}
});
jQuery('#gallery-9 .bxslider').bxSlider({
adaptiveHeight: true,
adaptiveHeightSpeed: 1000,
nextText: 'Page up',
prevText: 'Page down'
});
});
</script>
I expected the parser to not change the contents of this <script>
tag.
The HTML that actually gets output after the parser hook:
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery(".fancybox-9")
.attr('rel', 'gallery-9')
.fancybox({
tpl: {
closeBtn : '<a title="Close" class="fancybox-item fancybox-close" href="javascript:;">',
next : '<a title="Next image" class="fancybox-nav fancybox-next" href="javascript:;"><span>',
prev : '<a title="Previous Image" class="fancybox-nav fancybox-prev" href="javascript:;"><span>'
},
openEffect : 'elastic',
openSpeed : 150,
closeEffect : 'elastic',
closeSpeed : 150,
closeClick : true,
playSpeed: 3000,
beforeShow: function () {},
afterShow: function() {
overlay : null
},
helpers : {
buttons : {
position: 'top',
tpl : '<div id="fancybox-buttons"><ul><li><a class="btnPrev" title="Previous Image" href="javascript:;"><li><a class="btnPlay" title="Start Slideshow" href="javascript:;"><li><a class="btnNext" title="Next image" href="javascript:;"><li><a class="btnToggle" title="toggle Size" href="javascript:;"><li><a class="btnClose" title="Close" href="javascript:;"></script></div>'
},
title : {
type: 'inside'
}
}
});
jQuery('#gallery-9 .bxslider').bxSlider({
adaptiveHeight: true,
adaptiveHeightSpeed: 1000,
nextText: 'Page up',
prevText: 'Page down'
});
});
As you can see, several of the strings got mangled. That includes missing </a>
, </span>
, and other closing tags, as well as the closing </script>
tag being moved into the tpl : '<div id="fancybox-buttons"> [...]
line, effectively breaking the entire page output.
Defining an array constant is new in PHP 5.6. The extension config for PHP is 5.4. So this causes an error for PHP < 5.6:
const ALWAYS_IGNORE_PARENT_TAGS = array('a', 'script');
Fatal error: Arrays are not allowed in class constants in typo3conf/ext/dpn_glossary/Classes/Service/ParserService.php on line 49
The current regex is kind of stupid, it should be reduced to the content of the body.
Maybe implement some small UnitTests to test the pagination ViewHelper etc.
typoscript if statement on the parameter has to be implemented
[31-Jul-2015 11:14:21 UTC] PHP Catchable fatal error: Argument 1 passed to TYPO3\CMS\Core\Utility\GeneralUtility::removeDotsFromTS() must be of the type array, null given, called in /src/typo3conf/ext/dpn_glossary/Classes/Service/WrapperService.php on line 103 and defined in /typo3_src-6.2.14/typo3/sysext/core/Classes/Utility/GeneralUtility.php on line 1845
[31-Jul-2015 11:14:21 UTC] PHP Stack trace:
[31-Jul-2015 11:14:21 UTC] PHP 1. {main}() /typo3_src-6.2.14/index.php:0
[31-Jul-2015 11:14:21 UTC] PHP 2. require() /typo3_src-6.2.14/index.php:28
[31-Jul-2015 11:14:21 UTC] PHP 3. TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController->generatePage_postProcessing() /typo3_src-6.2.14/typo3/sysext/cms/tslib/index_ts.php:216
[31-Jul-2015 11:14:21 UTC] PHP 4. TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction() /typo3_src-6.2.14/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php:3559
[31-Jul-2015 11:14:21 UTC] PHP 5. TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance() /typo3_src-6.2.14/typo3/sysext/core/Classes/Utility/GeneralUtility.php:4286
[31-Jul-2015 11:14:21 UTC] PHP 6. TYPO3\CMS\Core\Utility\GeneralUtility::instantiateClass() /typo3_src-6.2.14/typo3/sysext/core/Classes/Utility/GeneralUtility.php:4415
[31-Jul-2015 11:14:21 UTC] PHP 7. DPN\DpnGlossary\Service\WrapperService->__construct() /typo3_src-6.2.14/typo3/sysext/core/Classes/Utility/GeneralUtility.php:4433
[31-Jul-2015 11:14:21 UTC] PHP 8. TYPO3\CMS\Core\Utility\GeneralUtility::removeDotsFromTS() /src/typo3conf/ext/dpn_glossary/Classes/Service/WrapperService.php:103
to avoid this, check if $this->tsConfig['settings.'] is an array in WrapperService.php in line 103:
if (is_array($this->tsConfig['settings.'])) {
$this->settings = GeneralUtility::removeDotsFromTS($this->tsConfig['settings.']);
}
E.g. for home display content element like "the latest added glossary items" or "3 random entries".
Hi,
I will migrate my old glossary (EXT:contagged) to dpn_glossary, but in contagged there are some more fields like: term_alt, term_type, term_lang, dam_images (maybe now FAL reference), multimedia (maybe now FAL file reference), related and link. Is it possible to add these fields in dpn_glossary? Sure, I could extend it by my self, but I think it would be a great addition for dpn_glossary. (Pull-Request: #4)
I missing one feature: replace only the first found term, not all on a page (Issue: #8 Pull-Request #9)
use different wraps for the terms, e.g. based on term_type field (Pull-Request: #4)
Sorting options by TypoScript? e.g. sort by title for the list view
new action: group terms by first char e.g. for a character navigation (Pull-Request: #6 )
I could do some of these changes, but I would only do it, if it is ok for you and my changes will be merged back to the core of your extension.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.