solved Configuring Tinymce

TiG
TiG
@tig
7 years ago
184 posts
Besides Core->Quota Allowed HTML, etc. and jrCore form_editor.tpl are there other places which contribute to the configuration of Tinymce? Specifically, I am trying to determine why toolbar options such as bullist and numlist do not show up on the Tinymce toolbar.

They are there in the toolbar spec, but are smarty-conditioned with logic such as {if $ul || $li}. It would save me considerable time hunting if I knew where/how these variables are set.

Thanks in advance.


--
TiG

updated by @tig: 12/24/17 03:55:37AM
michael
@michael
7 years ago
7,692 posts
There are 2 locations the form is intalized
/modules/jrCore/templates/form_editor.tpl
/modules/jrSiteBuilder/templates/form_editor.tpl

The $ul || $li are checks run off the values listed in the quotas "Allowed HTML Tags" found at:
ACP -> MODULES -> CORE -> SYSTEM CORE -> QUOTA CONFIG -> Allowed HTML Tags

If 'ul' and 'li' are not allowed there, then there is no sense in showing the button because they will be stripped out.

Each of those Allowed HTML Tags will be its own variable name in the form_editor.tpl
span,strong,em,a,b,u,i,p,div,br,img,h1,h2,h3,h4,pre,hr,ul,ol,li,sub,sup,table,tbody,th,tr,td


Since both of those files are in core modules that may be updated in the future, the location to adjust them that will be safe from updates is either on the TEMPLATES tab in the acp, eg:
ACP -> MODULES -> CORE -> SYSTEM CORE -> TEMPLATES -> form_editor.tpl -> MODIFY

OR by defining the equivalent file in the skin using the naming override convention. If you wanted to override
/modules/jrCore/templates/form_editor.tpl

Then copy it to the skin and call it:
/skins/YOUR SKIN/jrCore_form_editor.tpl

(But if you ALSO have an override in the TEMPLATES tab, then it will have the last word, so better to pick either the filesystem or the ACP as both can get confusing. I prefer the file system.)

--edit--

Docs: "Altering a modules template"
https://www.jamroom.net/the-jamroom-network/documentation/module-developer-guide/1051/altering-a-modules-template
updated by @michael: 09/17/17 09:54:38PM
TiG
TiG
@tig
7 years ago
184 posts
@michael

Thanks for that valuable info.

The 'ul' and 'li' tags are listed in the allowed HTML tags section so the smarty logic should kick in. Based on your reply I will now assume they are properly set and continue my hunting with that assumption. Probably some little nit that is causing this.

[ As an aside, I too favor the file overrides since that keeps all changes within the scope of tools such as PHPStorm. Search is so important and it is frustrating when actionable code (especially override code) is stuck away in a database outside of the reach of development tools. ]


--
TiG
michael
@michael
7 years ago
7,692 posts
agreed. The most confusing override situation I have run into is:

An override has been placed on a modules template via the ACP at somewhere like
ACP -> MODULES -> SOME MODULE -> TEMPLATES -> item_list.tpl -> MODIFY

THEN that template has been over-ridden in the skins with
/skins/(the skin)/jrSomeModule_item_list.tpl

THEN that template has been over-ridden by a change in the ACP at
ACP -> SKINS -> THE SKIN -> TEMPLATES -> jrSomeModule_item_list.tpl -> MODIFY

Hard to figure out. :)

If you're using PhpStorm, then the docblocks for modules contain a good amount of info. (screenshot)

For your situation, my guess is you're looking at an editor in the profiles, but adjusting the form_editor.tpl for Site Builder, or vice versa.

--edit--
TIP: If you're working on a skin that has a lot of TEMPLATE overrides from the ACP, clone it. Cloning a skin will move the ACP overrides into the file system version of the skin.
phpstorm.jpg
phpstorm.jpg  •  129KB


updated by @michael: 09/18/17 04:05:18PM

Tags