Code Monkey home page Code Monkey logo

dpn_glossary's Introduction

dpn_glossary

A TYPO3 extension for a glossary and a contentparser to link terms to a detailpage.

Links:

Features:

  • Simple configuration
  • Automatic parsing of terms

dpn_glossary's People

Contributors

bjo3rnf avatar criwe avatar dogawaf avatar featdd avatar fladi avatar ghermens avatar julianhofmann avatar kitzberger avatar linawolf avatar p2media avatar rauchf avatar rico3000 avatar rotespferd avatar schloram avatar sneopu avatar tillhoerner avatar tomkuehl avatar webdiscus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

dpn_glossary's Issues

Update RealUrl Config and separate list and detail action

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.

Hiding the glossary detail page in url structure

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 ...

synonym is required in BE?

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

[QUESTION] WrapperService

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

Show glossary name in Breadcrumbs on Detail page.

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?

Synonyms in list

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>

php support

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 :-)

"parsingPidsExcludePidList" not working for detailpage

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!

HTML output from ParserService is invalid when using conditional comments

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.

Abbreviation spelling

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

had to proove it myself ... you're not alone ;)

Links to entry detail generate duplicate content

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

MaxReplacementsPerPage is not per page but per tag

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?

TYPO3 7.6.10 crashed after update

Hi,
I just tried to update to the latest version from TER. This crashed the TYPO3 Installation.
Any suggestions?
Thanks,
Manfred

image

Removing the extension manually helped. After that it was possible to install it again but that leads in the same error...

Error in Typo3 7.1

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

Unable to set custom template paths.

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:

  • Setting the template paths in the constants-editor in the TYPO3 backend.
  • Setting the template paths in an external setup file.
  • Setting the template paths in an external constants file.
  • Setting the template paths in the setup file in the ext folder (original file)
  • Setting the template paths in the constants file in the ext folder (original file)

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

Page times out when the page content matches a glossary term and no forbiddenParentTags are set

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-&gt;run() /home/typo3/typo3_src/typo3_src-7.2.0/index.php:33
    0.0818    2956776   3. TYPO3\CMS\Frontend\RequestHandler-&gt;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-&gt;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-&gt;contentParser() /home/typo3/typo3_src/typo3_src-7.2.0/typo3/sysext/core/Classes/Utility/GeneralUtility.php:4155
  601.1411   21096992   8. DOMNode-&gt;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.

List & detail on same page

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?

Code cleanup

check everything for cgl and correctness of settings in TYPO3 files

Content of <script> tags gets mangled

Situation

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>

Expected behaviour

I expected the parser to not change the contents of this <script> tag.

Actual behaviour

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.

Fatal error: Arrays are not allowed in class constants

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

UnitTests

Maybe implement some small UnitTests to test the pagination ViewHelper etc.

Fatal error is thrown when installed but not configured

[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.']);
}

[QUESTION] Some guestions?

Hi,

  1. 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)

  2. I missing one feature: replace only the first found term, not all on a page (Issue: #8 Pull-Request #9)

  3. use different wraps for the terms, e.g. based on term_type field (Pull-Request: #4)

  4. Sorting options by TypoScript? e.g. sort by title for the list view

  5. 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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.