CMS TYPO3 an extension for output of editing toolbar on a website

CMS TYPO3 – an extension for output of editing toolbar on a website Latest version 0.0.4: https://typo3.org/extensions/repository/view/phptemplate Su...
Author: Reginald Tate
7 downloads 2 Views 4MB Size
CMS TYPO3 – an extension for output of editing toolbar on a website Latest version 0.0.4: https://typo3.org/extensions/repository/view/phptemplate

Supported system versions: TYPO3 TYPO3 TYPO3 TYPO3 TYPO3 TYPO3

4.4+ 4.5-4.7+ 6.0-6.1+ 6.2+ 7.0+ 8.0+

Ivan Litovchenko, 2016 1

Purpose of extension The main idea is to simplify the task for a content manager while data search or posting some new content on a website. When user is authorized in security unit, the extension allows to display on the site some new toolbars with editing bullets next to the website contents, which support four core actions: add, edit, enable/disable and delete content item.

Extension installation (step-by-step) 1. Extension installation in “Extension manager” In order to install the extension, you need to go to the section “Extension manager”. Next choose the tab “Import”, search the extension by the key "phptemplate" and perform its import into the system. Further, check the tab “Available extensions” to get sure that the implemented extension was installed after the import – you can tell this by the green icon opposite to its title.

2

2. Extension option description in “Extension manager” The extension includes some of general options, commonly used in various projects with CMS TYPO3: - checkbox “Disable all sys log”; - checkbox “Redirect www to not www”; - checkbox “Enable sRGB” – required by some recent hostings, which support Imagemagick; - drop-down list “Image quality settings” – currently not relevant.

3

3. Customizing site template After extension installation and setting, activate static templates in following sequence (the second template is activated optionally): 1. Template (CSS Styled Content edit Icon) (phptemplate) 2. Template (Page Default Config) (phptemplate) ! Attention: Template (CSS Styled Content edit Icon) (phptemplate) should be activated only after template "CSS Styled Content TYPO3 …", or otherwise editing toolbars for content items (content elements) wouldn’t be displayed.

4

4. Debugging TinyMCE RTE (tinymce_rte) visual editor https://typo3.org/extensions/repository/view/tinymce_rte Operating visual editor TinyMCE RTE in previous CMS TYPO3 versions from 4.5.0 to 6.1.99, import and install the patch TinyMCE RTE (mini patch) (tinymce_rte_patch), which debugs editor initialization while switching to front-end entry editing form.

To download the patch use the link below: https://typo3.org/extensions/repository/view/tinymce_rte_patch 5. Further installation implies setup of the control panel output to the front-end interface.

5

Control panel output setup (Typoscript-code) # Main control panel page.config.adminPanel = 1 # display control panel on site pages page.config.adminPanel.addedToFooter = 1 # display control panel in page footer # Notepad sidebar page.config.adminPanelNotepad = 1 # display notepad sidebar on site pages

Example of "tt_news" extension editing toolbar output setup (Typoscript-code) plugin.tt_news { # LIST view displayList.title_stdWrap.editPanel = 1 displayList.title_stdWrap.editPanel.tableName = tt_news displayList.title_stdWrap.editPanel.title = Edit # LATEST view displayLatest.title_stdWrap.editPanel = 1 displayLatest.title_stdWrap.editPanel.tableName = tt_news displayLatest.title_stdWrap.editPanel.title = Edit # SINGLE view displaySingle.title_stdWrap.editPanel = 1 displaySingle.title_stdWrap.editPanel.tableName = tt_news displaySingle.title_stdWrap.editPanel.title = Edit displaySingle.title_stdWrap.editPanel.otherArg.hideNewIcon = 1 }

6

Control panel option description

Option

Description Reference information indicating type and ID of current page. Purple color indicates a normal page (physically exists in site structure). Carmine-red color indicates a virtual page with a cHash-parameter in Typolink. Light grey color indicates a virtual page without a cHash-parameter in Typolink. Reset current page cache Reset whole site cache Enable/disable site edit mode. Editing toolbars display on the site when edit mode is enabled Change editing toolbars color (light colors for darker colored sites, dark ones – for light colored sites) Translation marks display tool. Supported for seldom projects Typoscript-box display tool. Supported for seldom projects Show/hide hidden records Quick switch to backend interface System exit

7

Notepad sidebar – "System news" table records as data source

Editing toolbar option description

Option

Description Edit item Create new item (default: new record is stored in the same repository “PID” as the current record) Enable/disable item Delete item

Only for "tt_content" table records Move record on current page Copy item (currently not supported) Cut item (currently not supported)

8

Usage and call of editing toolbars in PHP-code while extension design (example for CMS TYPO3 version 4.54.7) 1. Create PHP-file at the address "fileadmin/template/test.php" 2. Plugin PHP_SCRIPT_INT item to site template

page.10 = PHP_SCRIPT_INT page.10.file = fileadmin/template/test.php

3. Options available in PHP-code ("test.php" file)



9

Accepted function argument description t3lib_frontend::editIcon(), t3lib_frontend::editIconAbs(), t3lib_frontend::editIconInline() Table of arguments: Argument

Necessity

Meaning example

Argument description

1

$table (string)

Yes

"sys_news"

Table title

2

$recordId (int)

Yes

1

Record ID

3

$title (string)

No

"Edit record"

Button title

4

$otherArg (array)

No

array( "columnsOnly" => "field_1" )

Extra options for editing toolbar

Usage example:

$table = " sys_news "; $recordId = 1; $title = " Edit record "; $editIcon = t3lib_frontend::editIcon($table, $recordId, $title, array( // Copy listed fields in the original record when creating new record 'copyFieldForNewIcon' => 'title,field_2 ', // Leave in the edit form only specified columns (when go to edit form) 'columnsOnly' => 'field_1,field_2 ', // Block the availability of the following commands: 'hideNewIcon' => TRUE, // command "create new record" 'hideDisableIcon' => TRUE, // command "enable/disable" 'hideDeletedIcon' => TRUE, // command "delete to trashbin" // Prohibit display of detailed information about a record by hover of mouse over editing toolbar 'hideHoverInfo' => TRUE, // Visual preferences ( ::editIconAbs() only) 'styleTop' => 10, // top indent for editing toolbar 'styleLeft' => 10, // left indent for editing toolbar ));

10

Explanation to distinction among editIcon(), editIconAbs() and editIconInline() On call: - t3lib_frontend::editIcon() editing toolbar displays as a block item (CSSstyle "display: block"); - t3lib_frontend::editIconAbs() editing toolbar displays without displacement of content item (CSS-style "position: absolute"); - t3lib_frontend::editIconInline() editing toolbar displays in a line (CSS-style "display: inline-block").

11

Future plans 1. Consider access permission of authorized user while editing toolbar displaying. 2. Editing toolbar lockout for currently editing records (sys_lockedrecords). 3. Display of website structure with add, rearrange, edit and delete page options. 4. Adjust extension for combining with other extensions, which provide grid construction in system (EXT: Gridelements and other). 5. Adjust editing toolbar styles for next system versions. 6. Project localization (German, English, Chinese). 7. Adding of parameter "page.config.disableAllEditIcon = 1". 8. Bring extension to independent level, key rename.

Download link https://typo3.org/extensions/repository/view/phptemplate

Integration examples

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

Suggest Documents