libeo / pagerating
Page rating
Requires
- evoweb/recaptcha: ^14.1
- typo3/cms-core: ^13.4
- typo3/cms-extbase: ^13.4
- typo3/cms-fluid: ^13.4
Suggests
- typo3/cms-frontend: ^13.4
README
This extension adds a plugin that shows a comment form about the page, asking if the page was useful, then showing a textarea for a comment. The form is sent by Ajax and a confirmation message is displayed.
The form content is saved in the database.
Configuration
- Add the Site Set
libeo/pageratingto your Site Package. - Define the
plugin.tx_lbopagerating.persistence.storagePidconstant with the page uid where the comments should be saved.
Add the plugin on a page
- On the Page Module, add a content via the
Create new contentbutton. - In the modal, select the
Page Ratingplugin. - Define the header (type
Hiddenis preferred). - In the
Configurationtab, set the Title and Confirmation message to display. If none defined, the default will be used.
Add the plugin automatically in a template
The extension add a field named Display page evaluation block in the Behavior tab of pages.
It can be used to trigger the display of the plugin automatically.
Here is an example of how to do this:
- Add the plugin somewhere in your site (ex: in a folder with reusable contents)
- Add a
libin your Site Package that look like that:lib.lbo_pagerating = CONTENT lib.lbo_pagerating { if.isTrue.field = lbo_pagerating table = tt_content select.uidInList = 123 select.pidInList = 0 }123is the uid of the content created a step 1. - In your Page Template, add a cObject View Helper:
<f:cObject typoscriptObjectPath="lib.lbo_pagerating" data="{page.pageRecord}" />pageis a variable available automatically in the template if a PAGEVIEW is used to render the pages. - The cObject
lib.lbo_pageratingwill be displayed if the fieldDisplay page evaluation blockis active on the page.
Labels and translation
You can use TypoScript to override the default Title and Confirmation message of the plugin.
plugin.tx_lbopagerating._LOCAL_LANG.default.form {
title = How's your experience?
saved = Your comments have been saved. Thanks!
}
See the Resources/Private/Language/locallang.xlf for all the labels.
Maximum comments length
You can configure the comment maximum length by configuring the constant plugin.tx_lbopagerating.commentsMaxChar.
The default is 500 characters.
plugin.tx_lbopagerating.commentsMaxChar = 750