TIP OF THE HOUR
OK GOOGLE, How Do I use NewsPublisher with TinymceWrapper? -
(without the magic)
TinyMagicPublisher!
Find this code and working demo in
tw_traditional_create_page.html, a demo resource optionally installed by
TinymceWrapper
Note! TinyMagicPublisher takes property sets. Go easy on your sight.
[[!TinyMagicPublisher?
//tame the Magic, force ordinary NewsPublisher mode
&npPureMagicNonTraditional=`0`
//insert any TinyMCE init as promised by tinymce.com
//takes multiple inits; user can have different config for different text fields - see below below
//img/file fields are handled automatically as per custom filetpl tpl below
&npTraditionalTinyChunk=`TinymceWrapperNPtraditional`
&usetabs=`0`
&tabs=`{
"Main" : ["pagetitle","introtext","content"],
"Dates" : ["pub_date", "unpub_date"],
"Publish" : ["publish"]
}`
&cssfile=``
&tinymceCDN=`//cdn.tinymce.com/4/tinymce.min.js`
//optional browser stuff
&autoFileBrowser=`responsivefilemanagerBrowser`
&elFinderBrowserRTEurl=`mainSite.com/elFinder.html`
&responsivefilemanagerBrowserRTEurl=`[[++assets_url]]components/tinymcewrapper/responsivefilemanager/filemanager/dialog.php?type=1`
&responsivefilemanagerBrowserRTEtitle=`Responsive FileManager`
&roxyFilemanBrowserRTEtitle=`Roxy Fileman`
&roxyFilemanBrowserRTEurl=`[[++assets_url]]components/tinymcewrapper/fileman/roxy.php`
&parentid=`12`
&templateid=`templateNameOrID`
&show=`pagetitle,introtext,content,TinymceWrapperMiscTV2,TinyJSONGalleryTV,longtitle,hidemenu,published,description,menutitle,pub_date,unpub_date,parent`
&required=`pagetitle,content`
&initdatepicker=`1`
//for auto latching of custom browsers
&filetpl=`twBROWSERnpFileTpl`
&imagetpl=`twBROWSERnpImageTpl`
&deletebutton=`1`
&duplicatebutton=`1`
&confirmdelete=`1`
&modxGalleryAssetsUrl =`[[++assets_url]]`
&TinyJSONGalleryJS = `[[++assets_url]]components/tinymcewrapper/gallery/js/TinyJSONGallery.js`
&galleryBackUpRTEskin = `[[++assets_url]]/components/tinymcewrapper/tinymceskins/modxPericles`
]]
TinymceWrapperNPtraditional
- You can mirror the exact TinyMCE settings you have in the backend. Cool!
- As usual, selector takes all kinds of querying. Use jQuery-style wildcards .. take this thing to town!
- If you want to use MODX Native filebrowser, write up a JS bridge and use file_browser_callback: autoFileBrowser,
- You can have as many TinyMCE inits to affect different text fields differently
tinymce.init({
selector: "#np-introtext",
skin_url: '[[++assets_url]]components/tinymcewrapper/tinymceskins/modxPericles',
menubar: false,
statusbar: false,
external_plugins: {
twAceEditor: "[[++assets_url]]components/tinymcewrapper/tinymceplugins/twAceEditor.js",
// twCodeMirror: "[[++assets_url]]components/tinymcewrapper/tinymceplugins/twCodeMirror.js",
//bubbleBar: "[[++assets_url]]components/tinymcewrapper/tinymceplugins/tinymceBubbleBar.js",
// twExoticMarkdownEditor: "[[++assets_url]]components/tinymcewrapper/tinymceplugins/twExoticMarkdownEditor.js",
modxMagicHoverLink: "[[++assets_url]]components/tinymcewrapper/tinymceplugins/modxMagicHoverLink.js",
twPreCodeManager: "[[++assets_url]]components/tinymcewrapper/tinymceplugins/twPreCodeManager.js"
},
file_browser_callback: autoFileBrowser,
plugins: "contextmenu,charmap,paste,link,preview,code,insertdatetime",
toolbar: "twPreCodeManager | undo redo | newdocument | preview code | styleselect | blockquote | bold | italic | bullist numlist | link unlink | charmap | insertdatetime",
contextmenu: "twPreCodeManager link code styleselect",
resize: true
});
tinymce.init({
selector: "#np-description",
skin_url: '[[++assets_url]]components/tinymcewrapper/tinymceskins/modxPericles',
menubar: false,
statusbar: false,
image_advtab: true,
external_plugins: {
twAceEditor: "[[++assets_url]]components/tinymcewrapper/tinymceplugins/twAceEditor.js",
// twCodeMirror: "[[++assets_url]]components/tinymcewrapper/tinymceplugins/twCodeMirror.js",
//bubbleBar: "[[++assets_url]]components/tinymcewrapper/tinymceplugins/tinymceBubbleBar.js",
// twExoticMarkdownEditor: "[[++assets_url]]components/tinymcewrapper/tinymceplugins/twExoticMarkdownEditor.js",
modxMagicHoverLink: "[[++assets_url]]components/tinymcewrapper/tinymceplugins/modxMagicHoverLink.js",
twPreCodeManager: "[[++assets_url]]components/tinymcewrapper/tinymceplugins/twPreCodeManager.js"
},
file_browser_callback: autoFileBrowser,
plugins: "contextmenu,charmap,paste,preview,code,insertdatetime",
toolbar: "twPreCodeManager | undo redo | newdocument | preview code | styleselect | blockquote | bold | italic | bullist numlist | link unlink | charmap | insertdatetime",
contextmenu: "twPreCodeManager link code styleselect",
resize: true
});
Cheers
[ed. note: donshakespeare last edited this post 7 years, 3 months ago.]