Joomla 2.5:内容中的mootools树-如何?

Joomla 2.5:内容中的mootools树-如何?,joomla,mootools,joomla2.5,Joomla,Mootools,Joomla2.5,我有一篇文章有几个大的列表,我想通过将-结构转换成mootools树(遵循中的示例),使它们更易于导航 因此,我已经禁用了任何文本过滤(仅针对我的管理员用户),并且正在使用“无编辑器”来启用纯文本输入,我已经输入了以下代码,希望它能够将Joomla中的mootools.tree-activation与示例结合起来,但没有显示树 有什么想法吗 <?php JHTML::_( 'behavior.tree', 'mytree' ); ?> <script type="tex

我有一篇文章有几个大的列表,我想通过将-结构转换成mootools树(遵循中的示例),使它们更易于导航

因此,我已经禁用了任何文本过滤(仅针对我的管理员用户),并且正在使用“无编辑器”来启用纯文本输入,我已经输入了以下代码,希望它能够将Joomla中的mootools.tree-activation与示例结合起来,但没有显示树

有什么想法吗

    <?php
JHTML::_( 'behavior.tree', 'mytree' );
?>
<script type="text/javascript">

var tree;

window.onload = function() {

// --- ordinary MooTreeControl example:

tree = new MooTreeControl({
div: 'mytree',
mode: 'files',
grid: true
},{
text: 'Root Node',
open: true
});

tree.disable(); // this stops visual updates while we're building the tree...

var node1 = tree.insert({text:'Subnode 1', id:'1'});
var node2 = tree.insert({text:'Subnode 2', id:'2', icon:'sample_icons.gif#1', openicon:'sample_icons.gif#2'});
var node3 = tree.insert({text:'Subnode 3', id:'3'});

var node2_1 = node2.insert({text:'Subnode 2.1', id:'2.1'});
var node2_2 = node2.insert({text:'Subnode 2.2', id:'2.2', color:'#ff0000'});
var node2_3 = node2.insert({text:'Subnode 2.3', id:'2.3'});

var node2_2_1 = node2_2.insert({text:'Subnode 2.2.1', id:'2.2.1', color:'#00a000'});
var node2_2_1_1 = node2_2_1.insert({text:'Subnode 2.2.1.1', id:'2.2.1.1', color:'#0000ff'});

var node4 = tree.insert({text:'Subnode 4', id:'4', icon:'sample_icons.gif#3'});

tree.expand();

tree.enable(); // this turns visual updates on again.

}

function find_node() {
var node = tree.get( $('nodeid_input').value );
window.alert( node ? 'found: ' + node.text : 'not found...' );
}

</script>


<h2>mooTree 2</h2>
<h4>example 1: basic tree example</h4>

<p>
This demonstrates most of the basic features of MooTree, including enable() and disable() which can be used
to minimize the number of visual updates performed.
</p>

<p>
This example also demonstrates basic usage of the get() method and node id's - for example, type "2.2" in the
text input at the bottom of this page, and press "find node".
</p>

<div id="mytree">
</div>

<p>
<input type="button" value=" expand all " onclick="tree.expand()" />
<input type="button" value=" collapse all " onclick="tree.collapse()" />
<input type="text" value="" id="nodeid_input" value="2.2" /><input type="submit" value="Find node" onclick="find_node()" />
</p>

整个问题目前都在本地主机上运行,因此我无法提供实时URL,抱歉。

好的,我最终通过使用mooTree列表插件解决了这个问题…谢谢您的帮助

好的,我终于用mooTree列表插件解决了这个问题,来自…谢谢你的帮助

Mootools文件中的版本是什么?在您的帖子中,您粘贴了与链接到的示例相同的代码(也在这里),但您的意思是希望从html i supose创建一个树,而不是每个节点编写节点。如果正确,请发布一些列表的代码示例。列表上的最后一个错误很重要:
MooTreeControl未定义
-您是否加载了MooTree
.js
.css
文件?(1)Weill,由于我的代码不起作用,我尝试了这个示例-虽然我可以看到它在纯HTML中工作,将其插入Joomla内容时,它不起作用。在我自己的例子中,我以同样的方式构建树(并且在JS不可用的情况下,将ul结构放在适当的位置。当JS可用时,我做的第一件事是隐藏包含ul的div…)(2)我没有显式地加载它们,因为
-东西应该在Joomla中触发加载。但你说得对,他们实际上不包括在内!所以我已经确保它们已加载,接下来出现的错误是
[14:50:58.221]TypeError:variable a redecares argument@http://localhost/media/system/js/mootree.js:1
您收到的大多数错误都是可以忽略的警告。有些是针对
/system/js/core.js
,不知道里面有什么。不管怎么说,你说它可以在纯HTML中工作,但当它插入Joomla内容时就不行了?我不太了解乔姆拉,乔姆拉的内容是什么?如果不是在“Joomla内容”中,你有HTML吗?Mootools文件中的版本是什么?在您的帖子中,您粘贴了与链接到的示例相同的代码(也在这里),但您的意思是希望从html i supose创建一个树,而不是每个节点编写节点。如果正确,请发布一些列表的代码示例。列表上的最后一个错误很重要:
MooTreeControl未定义
-您是否加载了MooTree
.js
.css
文件?(1)Weill,由于我的代码不起作用,我尝试了这个示例-虽然我可以看到它在纯HTML中工作,将其插入Joomla内容时,它不起作用。在我自己的例子中,我以同样的方式构建树(并且在JS不可用的情况下,将ul结构放在适当的位置。当JS可用时,我做的第一件事是隐藏包含ul的div…)(2)我没有显式地加载它们,因为
-东西应该在Joomla中触发加载。但你说得对,他们实际上不包括在内!所以我已经确保它们已加载,接下来出现的错误是
[14:50:58.221]TypeError:variable a redecares argument@http://localhost/media/system/js/mootree.js:1
您收到的大多数错误都是可以忽略的警告。有些是针对
/system/js/core.js
,不知道里面有什么。不管怎么说,你说它可以在纯HTML中工作,但当它插入Joomla内容时就不行了?我不太了解乔姆拉,乔姆拉的内容是什么?如果不是在“Joomla内容”中,你有HTML吗?
[13:59:10.896] GET http://localhost/index.php/2-uncategorised/3-mootree [HTTP/1.1 200 OK 1319ms]
[13:59:12.201] GET http://localhost/templates/system/css/system.css [HTTP/1.1 304 Not Modified 2ms]
[13:59:12.202] GET http://localhost/templates/beez_20/css/position.css [HTTP/1.1 304 Not Modified 2ms]
[13:59:12.203] GET http://localhost/templates/beez_20/css/layout.css [HTTP/1.1 304 Not Modified 5ms]
[13:59:12.203] GET http://localhost/templates/beez_20/css/print.css [HTTP/1.1 304 Not Modified 8ms]
[13:59:12.204] GET http://localhost/templates/beez_20/css/general.css [HTTP/1.1 304 Not Modified 8ms]
[13:59:12.205] GET http://localhost/templates/beez_20/css/general_mozilla.css [HTTP/1.1 304 Not Modified 9ms]
[13:59:12.205] GET http://localhost/templates/beez_20/css/personal.css [HTTP/1.1 304 Not Modified 6ms]
[13:59:12.206] GET http://localhost/media/system/js/mootools-core.js [HTTP/1.1 304 Not Modified 6ms]
[13:59:12.206] GET http://localhost/media/system/js/core.js [HTTP/1.1 304 Not Modified 7ms]
[13:59:12.207] GET http://localhost/media/system/js/caption.js [HTTP/1.1 304 Not Modified 10ms]
[13:59:12.208] GET http://localhost/media/system/js/mootools-more.js [HTTP/1.1 304 Not Modified 8ms]
[13:59:12.209] GET http://localhost/templates/beez_20/javascript/md_stylechanger.js [HTTP/1.1 304 Not Modified 8ms]
[13:59:12.210] GET http://localhost/templates/beez_20/javascript/hide.js [HTTP/1.1 304 Not Modified 9ms]
[13:59:12.183] Unbekannte Eigenschaft '-moz-border-radius'.  Deklaration ignoriert. @ http://localhost/templates/beez_20/css/general_mozilla.css:13
[13:59:12.390] GET http://localhost/media/system/css/system.css [HTTP/1.1 304 Not Modified 1ms]
[13:59:12.242] TypeError: anonymous function does not always return a value @ http://localhost/media/system/js/mootools-core.js:123
[13:59:12.246] TypeError: anonymous function does not always return a value @ http://localhost/media/system/js/mootools-core.js:338
[13:59:12.246] TypeError: anonymous function does not always return a value @ http://localhost/media/system/js/mootools-core.js:340
[13:59:12.248] TypeError: anonymous function does not always return a value @ http://localhost/media/system/js/mootools-core.js:382
[13:59:12.255] ReferenceError: reference to undefined property v[i] @ http://localhost/media/system/js/mootools-core.js:42
[13:59:12.256] ReferenceError: reference to undefined property Element.prototype.fireEvent @ http://localhost/media/system/js/mootools-core.js:260
[13:59:12.256] ReferenceError: reference to undefined property a[1] @ http://localhost/media/system/js/mootools-core.js:272
[13:59:12.261] getAttributeNode() sollte nicht mehr verwendet werden. Verwenden Sie stattdessen getAttribute(). @ http://localhost/media/system/js/mootools-core.js:343
[13:59:12.268] TypeError: variable a redeclares argument @ http://localhost/media/system/js/core.js:9
[13:59:12.269] TypeError: function checkAll does not always return a value @ http://localhost/media/system/js/core.js:12
[13:59:12.274] TypeError: anonymous function does not always return a value @ http://localhost/media/system/js/mootools-more.js:247
[13:59:12.275] TypeError: anonymous function does not always return a value @ http://localhost/media/system/js/mootools-more.js:254
[13:59:12.277] TypeError: anonymous function does not always return a value @ http://localhost/media/system/js/mootools-more.js:378
[13:59:12.277] TypeError: anonymous function does not always return a value @ http://localhost/media/system/js/mootools-more.js:385
[13:59:12.282] TypeError: anonymous function does not always return a value @ http://localhost/media/system/js/mootools-more.js:612
[13:59:12.282] TypeError: anonymous function does not always return a value @ http://localhost/media/system/js/mootools-more.js:625
[13:59:12.283] TypeError: anonymous function does not always return a value @ http://localhost/media/system/js/mootools-more.js:628
[13:59:12.283] TypeError: anonymous function does not always return a value @ http://localhost/media/system/js/mootools-more.js:635
[13:59:12.283] TypeError: anonymous function does not always return a value @ http://localhost/media/system/js/mootools-more.js:638
[13:59:12.283] TypeError: anonymous function does not always return a value @ http://localhost/media/system/js/mootools-more.js:650
[13:59:12.284] TypeError: anonymous function does not always return a value @ http://localhost/media/system/js/mootools-more.js:686
[13:59:12.284] TypeError: anonymous function does not always return a value @ http://localhost/media/system/js/mootools-more.js:694
[13:59:12.284] SyntaxError: property name getSelected appears more than once in object literal @ http://localhost/media/system/js/mootools-more.js:695
[13:59:12.284] TypeError: anonymous function does not always return a value @ http://localhost/media/system/js/mootools-more.js:699
[13:59:12.284] TypeError: anonymous function does not always return a value @ http://localhost/media/system/js/mootools-more.js:700
[13:59:12.284] TypeError: anonymous function does not always return a value @ http://localhost/media/system/js/mootools-more.js:702
[13:59:12.284] SyntaxError: property name getSelected appears more than once in object literal @ http://localhost/media/system/js/mootools-more.js:703
[13:59:12.284] TypeError: anonymous function does not always return a value @ http://localhost/media/system/js/mootools-more.js:705
[13:59:12.289] ReferenceError: reference to undefined property this.Binds @ http://localhost/media/system/js/mootools-more.js:27
[13:59:12.291] ReferenceError: reference to undefined property this.document @ http://localhost/media/system/js/mootools-core.js:192
[13:59:12.291] ReferenceError: reference to undefined property this.document @ http://localhost/media/system/js/mootools-core.js:170
[13:59:12.293] ReferenceError: reference to undefined property this.parsed @ http://localhost/media/system/js/mootools-more.js:129
[13:59:12.528] GET http://localhost/templates/beez_20/images/personal/bg2.png [HTTP/1.1 304 Not Modified 3ms]
[13:59:12.528] GET http://localhost/images/joomla_black.gif [HTTP/1.1 304 Not Modified 2ms]
[13:59:12.529] GET http://localhost/templates/beez_20/images/system/arrow.png [HTTP/1.1 304 Not Modified 1ms]
[13:59:12.530] GET http://localhost/media/system/images/printButton.png [HTTP/1.1 304 Not Modified 1ms]
[13:59:12.530] GET http://localhost/media/system/images/emailButton.png [HTTP/1.1 304 Not Modified 1ms]
[13:59:12.531] GET http://localhost/templates/beez_20/images/personal/personal2.png [HTTP/1.1 304 Not Modified 2ms]
[13:59:12.531] GET http://localhost/templates/beez_20/images/nature/karo.gif [HTTP/1.1 304 Not Modified 2ms]
[13:59:12.532] GET http://localhost/templates/beez_20/images/content_bg.gif [HTTP/1.1 304 Not Modified 1ms]
[13:59:12.532] GET http://localhost/templates/beez_20/images/nature/arrow1.gif [HTTP/1.1 304 Not Modified 2ms]
[13:59:12.533] GET http://localhost/templates/beez_20/images/personal/tabs_back.png [HTTP/1.1 304 Not Modified 2ms]
[13:59:12.481] ReferenceError: assignment to undeclared variable STATE_PROVINCE_VALUE_MAPPING @ resource://gre/modules/XPIProvider.jsm -> jar:file:///C:/Users/MBaas/AppData/Roaming/Mozilla/Firefox/Profiles/b4ue9vdm.default/extensions/onepassword@agilebits.com.xpi!/bootstrap.js -> resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/loader/sandbox.js -> resource://onepassword-at-agilebits-dot-com/onepassword/data/src/end.min.js:32
[13:59:12.481] ReferenceError: assignment to undeclared variable STATE_PROVINCE_REGEX_MAPPING @ resource://gre/modules/XPIProvider.jsm -> jar:file:///C:/Users/MBaas/AppData/Roaming/Mozilla/Firefox/Profiles/b4ue9vdm.default/extensions/onepassword@agilebits.com.xpi!/bootstrap.js -> resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/loader/sandbox.js -> resource://onepassword-at-agilebits-dot-com/onepassword/data/src/end.min.js:32
[13:59:12.481] ReferenceError: assignment to undeclared variable COUNTRY_VALUE_MAPPING @ resource://gre/modules/XPIProvider.jsm -> jar:file:///C:/Users/MBaas/AppData/Roaming/Mozilla/Firefox/Profiles/b4ue9vdm.default/extensions/onepassword@agilebits.com.xpi!/bootstrap.js -> resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/loader/sandbox.js -> resource://onepassword-at-agilebits-dot-com/onepassword/data/src/end.min.js:32
[13:59:12.485] ReferenceError: MooTreeControl is not defined @ http://localhost/index.php/2-uncategorised/3-mootree:220