These instructions relate to Mosets Tree 3.5.8
When I used the category changer with the WYSIWYG enabled on the description field, the WYSIWYG content would get removed and the Save/Save and Close/Cancel buttons would no longer work.
These might not be the cause or a working solution to solve the problem permanetly and leave mosets tree functioning 100%.
Cause
Solution
Addendum
1 - My first Communication of the error on the Demo Site
There is a fault with your demo site.
I enabled wysiwyg for front and back end. i then edited a listing in the admin and changed its category. Once I changed the category and clicked update, the WYSIWYG content
disappears and a lot of stuff on the page stops working. I am using the latest version of firefox.
1 - Response from Mosets Tree
Thanks for your e-mail and feedback. This is indeed and known issue due to a limitation on Joomla's raw output the last time we checked. Because of this, we recommend our users to use non-wysiwyg editor (this is the default behaviour) or go directly to the category when you need to create a listing for it. We will keep an eye on this and provide a fix once that is possible.
Best regards,
CY Lee
2 - Issue raised with Mosets Tree with further information
All seems well until you change the category, the WYSIWYG content window is then emptied and the save/save and close/cancel buttons no longer function.
If you do not change the category the save/save and close/cancel buttons still work and the WYSIWYG content is preserved.
2 - Response from Mosets Tree
Thanks for the feedback. This is indeed a known issue to us when you have WYSIWYG editor and change category why editing your listing. It’s due to the fact that we use Joomla’s API to load the wysiwyg editor and there is no way to reactive it after a DOM refresh. We don’t have a solution for this now other than advising you to move the listing to another category before editing it - or don’t use wysiwyg editor if changing category during editing is a frequently used operation on your end.
We’re holding out for a more robust API from Joomla’s end so that we can resolve this. Sorry about the trouble Jon.
Best regards,
CY Lee
3 - An email with my research to help fix the issue
I have done some research into this issue and I don’t believe it is to do with the DOM refresh.
Using joomla 3.4.1
In category.js the error is related to the following code
html = items.join(''); jQuery('#mtfields div[id^="field_"]').remove(); jQuery(html).appendTo('#mtfields'); jQuery('#mtfields input, #mtfields select, #mtfields textarea').bind('change', function(event) {onChangeMTFieldsInput(event);});I have messed around with the code briefly and got the wysiwyg to work. These commands occur after the DOM refresh (I think).
Please find attached my research which you might find useful and hopefully a quick fix.
3 - Response from Mosets Tree
That portion of codes are responsible of actually updated the list of fields with a new set of fields of the newly selected category. It doesn’t solve the issue itself but does work if your work case does not require updating the set of fields (i.e.: all your category uses the same set of fields and you only need to update your category).
Best regards,
CY Lee
example.com/media/com_mtree/js/category.js
with the following i changed the category.js and clicked update, and then save. i also used tinymce
html = items.join(''); jQuery('#mtfields div[id^="field_"]').remove(); jQuery(html).appendTo('#mtfields'); jQuery('#mtfields input, #mtfields select, #mtfields textarea').bind('change', function(event) {onChangeMTFieldsInput(event);});
I removed the above code and checked:
html = items.join('');
i removed the above code and:
jQuery('#mtfields div[id^="field_"]').remove();
I removed the above code and:
jQuery(html).appendTo('#mtfields');
I removed the above code and:
jQuery('#mtfields input, #mtfields select, #mtfields textarea').bind('change', function(event) {onChangeMTFieldsInput(event);});
I removed the above code and:
Altering the following code allows you to use the WYSIWYG for the desctiption field and keep the save/save and close/cancel buttons to still work whilst creating records but does have the side effect that
That portion of codes are responsible of actually updated the list of fields with a new set of fields of the newly selected category. It doesn’t solve the issue itself but does work if your work case does not require updating the set of fields (i.e.: all your category uses the same set of fields and you only need to update your category).
Best regards,
CY Lee
The rought translation of the quote is that when you change category Mosets Tree will change the field list to match the new category, there might or might no be a change in the fields used. This code makes those changes. If like me you are using the same fields in all of your categories then removing this code will have not detrimental effect.
Open the file
example.com/media/com_mtree/js/category.js
and find the code block
html = items.join(''); jQuery('#mtfields div[id^="field_"]').remove(); jQuery(html).appendTo('#mtfields'); jQuery('#mtfields input, #mtfields select, #mtfields textarea').bind('change', function(event) {onChangeMTFieldsInput(event);}); });
and then REM the block out as follows
/*html = items.join(''); jQuery('#mtfields div[id^="field_"]').remove(); jQuery(html).appendTo('#mtfields'); jQuery('#mtfields input, #mtfields select, #mtfields textarea').bind('change', function(event) {onChangeMTFieldsInput(event);});*/ });
I would now make sure Mosets Tree works as you expect before massive data entry.
what I have done to mosets tree to set it up like Bookmarks.
These are changes to system files and are not user setable.
Template Mods
Core Mods
These are user setable settings in the Mosets Tree Backend.
Template Settings
Core Settings
Category Settings
General
the way mosets tree gets around multiple directories is as follows
Notes
Link Building
this seems to be an internal plugin that builds <a> tags
$this->plugin( 'ahreflisting', $link, $link_name->getOutput(2), '', array("edit"=>false,"delete"=>false), 1 );
Accessing field data in the template
// these do similiar things i think $website = $link_fields->getFieldById(12); // for core and custom, only returns if the feld is active. this loads the 12th field $website = $link->link_website; // for core only, always returns the vaule no boolean or permissions. link_website is a core table field/column from #__mt_links
ie. the code below checks to see if the website field is available and then if it is does it have a vaule, if both are positive then run code
// Website $website = $link_fields->getFieldById(12); if(!is_null($website) && $website->hasValue()) { echo '<p class="website">' . $website->getOutput(2) . '</p>'; }
When creating a new category in back end, the 'Use Main Index template page' options is set by default to on, this should be set to off by default.
Fix
administrator/components/com_mtree/models/forms/category.xml
fields && classes
mweblink
field class example - mweblink
mtree.php
D:\Documents\websites\lancast\htdocs\administrator\components\com_mtree\mtree.php
creating a CF value (custom field)
line 5320 - D:\Documents\websites\lancast\htdocs\administrator\components\com_mtree\mtree.php
table structure id cf_id link_id value attachment - Default = 0 counter - Default = 0
therefore only the first 4 things are created with values
Custom Fields
This tutorial is based on my GrabMeta Editor Button Plugin which I developed for myself. These instruction will be very similiar for a content plugin which I will address any differences at the end.
There are different types of plugins and I will list the ones I have created:
/grabmeta/language/
/grabmeta/language/en-GB/
/grabmeta/language/en-GB/en-GB.plg_editors-xtd_grabmeta.ini
/grabmeta/language/en-GB/en-GB.plg_editors-xtd_grabmeta.sys.ini
/grabmeta/grabmeta.php
/grabmeta/grabmeta.xml
/grabmeta/index.html
/grabmeta/script.php
/grabmeta/ language/en-GB/en-GB.plg_editors-xtd_grabmeta.ini
It should be noted that I think if there are translation files in the joomla system folders they might take priority over the local override files
/administrator/language/en-GB/ en-GB.plg_editors-xtd_grabmeta.ini /administrator/language/en-GB/ en-GB.plg_editors-xtd_grabmeta.sys.ini
en-GB.plg_editors-xtd_grabmeta.sys.ini
<languages>
<language tag="en-GB">language/en-GB/en-GB.plg_editors-xtd_grabmeta.ini</language>
<language tag="en-GB">language/en-GB/en-GB.plg_editors-xtd_grabmeta.sys.ini</language>
</languages>
/administrator/language/en-GB/
Notes specific to an editor button, not address above should as the button calling code.
There are some slightly different ways to execute code via the editor button.
Single Stage PHP
GrabMeta (AJAX /Multi Stage PHP)
Straight Button
Straight Button with Modal
Whereever your active code is run from, you sometimes need to pass variables or information to it. There are 2 basic ways of doing that in Joomla:
I will address the differences that are required for a content plugin
Language files
<languages> <language tag="en-GB">language/en-GB/en-GB.plg_content_executecode.ini</language> <language tag="en-GB">language/en-GB/en-GB.plg_content_executecode.sys.ini</language> </languages>
As you can see the plugin type aspect fo the file name has changed, and in this case the name of the plugin. You can have 2 plugins, one button and one content with the same name such as 'executecode'.
XML file
No thumbnails showing can be caused by issues at shrink the web, check the log files there and make sure you have the correct settings.
Links
* My demo might look slightly different in Joomla's frontend, this is due to WYSIWYG styling I cannot get rid off.
As you can see here i have built up a basic module layout to show you what it would look like. The main things to consider are that i have applied the .frame-1a class to the module suffix and a manually created incontainer div (in the module) to hold the content. The inner content has a fixed size as a block element witht he margins set to auto so it centres.
Because the inner content is a fixed size you can now have varying amounts of content and the modules will alwyas be the same size. you could created a class with the modules settings in and apply them by the template but it is far easier tocontrol them from within the WYSIWYG as layput is king.
Obviously if your content is deeper that the box can hold you can just make the boxes deeper, but make sure that you apply the changs to all of the boxes and not just the one.
In the code I have only showed the inner content code to keep things easy to understand as this is all you need to create a matching module, and the class code.
I have included the class code here that I have used but you can use an Image Frame style to replace the class,. You could evene try a mix and match approach to see what unique styles you can make. I have a KB article on Image Frames to have a look at.
.frame-1a { -moz-border-bottom-colors: none; -moz-border-left-colors: none; -moz-border-right-colors: none; -moz-border-top-colors: none; background: transparent -moz-linear-gradient(center top , #fafafa, #dddddd) repeat scroll 0 0; border-color: #c9cbcd; border-image: none; border-radius: 0; border-style: solid; border-width: 1px 1px 2px; box-shadow: 0 8px 6px -6px black; display: inline-block; outline: medium none; padding: 4px; transition: all 300ms ease-out 0s; }
This what the inner content should look like.
Put your own content here !!!
<div style="height: 360px; width: 300px;" class="frame-1a"> <p style="text-align: center;">Put your own content here !!!<p> <ul style="text-align: center; list-style-image: url('/images/common/tick.png');"> <li>And list items here !!!</li> </ul> </div>
Or with the code in the element
<div style="height: 360px; width: 300px; -moz-border-bottom-colors: none; -moz-border-left-colors: none; -moz-border-right-colors: none; -moz-border-top-colors: none; background: transparent -moz-linear-gradient(center top , #fafafa, #dddddd) repeat scroll 0 0; border-color: #c9cbcd; border-radius: 0; border-style: solid; border-width: 1px 1px 2px; box-shadow: 0 8px 6px -6px black; outline: medium none; padding: 4px; transition: all 300ms ease-out 0s;"> <p style="text-align: center;">Put your own content here !!!<p> <ul style="text-align: center; list-style-image: url('/images/common/tick.png');"> <li>And list items here !!!</li> </ul> </div>NB:
Alter the box size to your own preferences if required and why not try some different styles.
if you use a table it will automatically vertically align cells
![]() |
|
Footer vertical align text in middle right
<div style="float: right;"> <div style="height: 88px; display: table-cell; vertical-align: middle;"> Powered By <a href="http://www.quantumwarp.com/">QuantumWarp</a> </div> </div>
Thre are 2 ways to center and image, the old way and the new way. You can still use both.
Old Way
<p style="text-align: center;"><img src="/images/kb/2015/666/cat-whiskers-kitty-tabby-200x200.jpg" alt="cat whiskers kitty tabby 200x200" /></p>
New Way
<p><img src="/images/kb/2015/666/cat-whiskers-kitty-tabby-200x200.jpg" alt="cat whiskers kitty tabby 200x200" style="display: block; margin-left: auto; margin-right: auto;" /></p>
This is likely to happen when you are just using an inline class you have declared in the content to change how an image looks. Because Joomla template coders are always more precise with their CSS selectors these will always trump your simple CSS class declaration.
When I was making my 'image styling' page I discovered there were some stylings for K2 that was affecting my image CSS code. I then wrote a jQuery script that would disable the offending CSS file. This however had the effect of removing all of the K2 styling.
I had previously managed to overide the styling from the "jsn_ext_k2.css" by using !important on the rules i had added for my example. This would however add lots of time whenever i wanted to add inline CSS into my articles and I am all about saving time.
The next thing I thought off was to use an 'inline CSS reset' styling block, but I would still have to use !important in this code block to overide the same rules I had just overidden except I will have added another pointless styling level. The key to the reset.css to work is knowing how CSS works and scans through its code. The key point is to use the reset.css to disable the exact rules that are causing the issue, then use your other inline scripts normally. I had to use !important to make sure rules my were applied because a more specific rules for images was being loaded from the "jsn_ext_k2.css", the more precise the rule, the more important it is and therefore will overide any previous rules that were less specific. You can utilise the ibuilt DOM viwer of Firefox to get wheich CSS rules are causing the issue. You should only disable the rules in the reset.css script that are causing you isses, there is not point in making it over complicated. So this didnt work either.
Then it dawned on me, why don't I paste all of the class into the images style="", this worked well. Success!!!
There are many ways to declare CSS rules and styling but in this article I will be investigating overiding the following offending rules as this can be very useful if you need page specific rules and do not want to hack core code or you template's CSS files.
The Offending Rule
/* Line 553 jsn_ext_k2.css */ div.itemBody img, div.userItemList img, div.catItemBody img, div.tagItemBody img, div.latestItemBody img { max-width: 100%; border: medium none; padding: 0px; }
In the CSS file
<link rel="stylesheet" href="/templates/jsn_time_pro/ext/k2/jsn_ext_k2.css" type="text/css" />
I discovered a problem when declaring a CSS class in my article that I would then use to re-style some demo images. The rules above would always be applied after my inline delcared class and rules because it is more precise so causes the border and padding not getting applied correctly from my rules.
The inline code in question I want applied to an image.
/* Thin Grey border and shadow */ .frame-1 { -moz-border-bottom-colors: none; -moz-border-left-colors: none; -moz-border-right-colors: none; -moz-border-top-colors: none; background: transparent -moz-linear-gradient(center top , #fafafa, #dddddd) repeat scroll 0 0; border-color: #c9cbcd; border-image: none; border-radius: 0; border-style: solid; border-width: 1px 1px 2px; box-shadow: 0 8px 6px -6px black; display: inline-block; outline: medium none; padding: 4px; transition: all 300ms ease-out 0s; }
How the image first looked when applying the class
If you examine the CSS rules applied to this image you will find that the rules from jsn_ext_k2.css are being applied which removes the border and padding
How the image should look
For those interested i copied all of the rules frome the .frame-1 class into the style="" of the image, but how I got here is described below.
There are different wasy to manipulate CSS rules:
Notes:
The following code snippets all change their specifed elements to have the specified values.
<script type="text/javascript"> jQuery("img").css({ "border-color":"red", "border-width":"5px", "border-style":"solid", "padding":"5px"}); </script> <script type="text/javascript"> jQuery("div.itemBody img").css({ "border-color":"red", "border-width":"5px", "border-style":"solid", "padding":"5px"}); </script> <script type="text/javascript"> jQuery('div.itemBody img').css({ 'border-color':'red', 'border-width':'5px', 'border-style':'solid', 'padding':'5px'}); </script> <script type="text/javascript"> jQuery('div.itemBody img, div.userItemList img, div.catItemBody img, div.tagItemBody img, div.latestItemBody img').css({ 'border-color':'red', 'border-width':'5px', 'border-style':'solid', 'padding':'5px'}); </script>
Notes
This is something i always get mixed up with but basically if you want Javascript/Jquery to interact with an element then the script must be run after the element has been rendered. You can do this by:
Example
This Works !!! - This works because the script is executed after this element has been rendered !!!
<script type="text/javascript"> jQuery("p.testclass").css('background-color', 'red'); </script>
This does not work !!! The element was rendered after the script had been executed so was not altered.
Now that I have got that all out of my head here is the list of the recommended solutions:
I have not sorted them in to a prefered order of use yet, but from 1- 6 they get harder to configure.
This is probably a noobie question so i will warn you guys first but i am a bit stuck. I have had a look about and i do not know what to ask for except here.
I have installed projectfork and installed the PF Menu module. I am using SEF (native not extension). All the links are as follows
http://www.mysite.com/dashboard
http://www.mysite.com/projects
etc..
As you can see they are all root links, but i would like them like
http://www.mysite.com/projectfork/dashboard
http://www.mysite.com/projectfork/projects
On the docs site, the menus on the left do exactly this.
http://projectfork.net/docs
Are all the docs menus actually part of the main menu or is there a joomla trick i can use ie hidden menu item to get all the PF module menu to have 'normal' links?
Solution
Install Projectfork
Make the following changes:
PF Menu
Main Menu
PF Menu Module
You have now configured all your PF links to be under the directory projectfork.
Overview
This solution is not for when you have joomla into a sub-directory because, left as standard the same issue would arise but just in a sub-folder.
My method allows me to have all my projectfork links in the projectfork subfolder. With the standard install of PF and joomla, the PF Menu Module Links are all root items. I wanted my in a subfolder as if i had installed a seperate piece of software whilst everything else was kept route.
This probably arises because i will be using my website for more that PF.
Maybe the solution i have done above might be common Joomla stuff but i found it tricky. I did not even know about joomla 'Menu Alias Item' until today.