Page MenuHomeIn-Portal Phabricator

INP-1583 - Add support for "Content Templates" inside CKEditor
ClosedPublic

Authored by alex on Oct 14 2016, 8:10 AM.

Details

Test Plan

Part 1

  1. in IDE:
    • edit /themes/advanced/index.tpl template
    • after <inp2:st_ContentBlock num="1"/> tag add <inp2:st_ContentBlock num="2" mode="inline"/> tag
    • save changes
  2. in Admin Console
    • go to Website & ContentBrowse Website section
    • click on Content Mode button in top frame
    • confirm, that 2 content blocks are displayed
    • click Edit Content button and confirm, that CKEditor in opened window doesn't have Content Templates toolbar button
    • close content block editing window
    • click inside dotted area of 2nd content block (that is edited inline) and confirm, that CKEditor, that is shown inline doesn't have Content Templates toolbar button
    • click outside dotted area to stop editing

Part 2

  1. in IDE:
    • in each inp_ckconfig.js file (there are 2 of them) uncomment Templates toolbar button in all toolbar configurations
  2. in Admin Console
    • repeat test from Part 1, but this time confirm, that Content Templates toolbar button is present and clicking it opens modal window with 3 templates shown

Part 3

// Register a templates definition set named "default".
CKEDITOR.addTemplates('default', {
	// The name of sub folder which hold the shortcut preview images of the templates.
	imagesPath: CKEDITOR.getUrl( CKEDITOR.plugins.getPath( 'templates' ) + 'templates/images/' ),

	// The templates definitions.
	templates: [
		{
			title: 'Sample Template',
			image: '',
			description: 'Sample Template Description',
			html: '<h3>Sample Template</h3><div>Sample Template Body</div>'
		}
	]
});
  1. in IDE:
    • create /themes/advanced/platform/inc/templates.js file with above shown content
  2. in Admin Console
    • repeat test from Part 1, but this time confirm, that Content Templates toolbar button is present and clicking it opens modal window with 1 template from templates.js file created before

Diff Detail

Repository
rINP In-Portal
Branch
/in-portal/branches/5.3.x
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 799
Build 799: arc lint + arc unit

Event Timeline

alex updated this revision to Diff 599.Oct 14 2016, 8:10 AM
alex retitled this revision from to INP-1583 - Add support for "Content Templates" inside CKEditor.
alex updated this object.
alex edited the test plan for this revision. (Show Details)
alex added 1 JIRA issue(s): INP-1583.
alex edited the test plan for this revision. (Show Details)Oct 14 2016, 8:10 AM
alex edited edge metadata.
alex added a project: Restricted Project.Oct 14 2016, 8:14 AM
erik accepted this revision.Oct 17 2016, 5:05 AM
erik edited edge metadata.
This revision is now accepted and ready to land.Oct 17 2016, 5:05 AM
alex updated this revision to Diff 800.Jul 19 2017, 9:43 AM

Make added parameters of existing methods optional to avoid BC break.

This revision was automatically updated to reflect the committed changes.