简体   繁体   English

joomla中的JavaScript和CSS编辑器

[英]JavaScript and CSS Editor in joomla

As we see in Joomla 2.5 if we click on template then we saw lit of CSS. 正如我们在Joomla 2.5中看到的,如果单击模板,则会看到CSS亮点。 I want to generate exact list of JS(Javascript) files along with that. 我想随此生成JS(Javascript)文件的确切列表。 If we click on Javascript i am able to edit it. 如果我们单击Javascript,则可以对其进行编辑。 Now, second question how i can create up loader for Joomla Admin Panel. 现在,第二个问题是我如何为Joomla管理面板创建加载程序。 My clien want to upload CSS and JS files of his own. 我的客户想上传自己的CSS和JS文件。 I checked out few link and extensions but not able to understand. 我检查了一些链接和扩展名,但听不懂。 any help on above please I had check ed following link for uploading but not able to understand how to implement http://docs.joomla.org/Creating_a_file_uploader_in_your_component 上面的任何帮助,请检查下面的链接以进行上传,但无法理解如何实现http://docs.joomla.org/Creating_a_file_uploader_in_your_component

Thanks, Manpreet 谢谢,Manpreet

The CSS and JS editor is only available in some templates. CSS和JS编辑器仅在某些模板中可用。 Also it is able to edit the JS and CSS files that are embedded through your template. 它还能够编辑通过模板嵌入的JS和CSS文件。 You can view these files in your index.php (/templates/your_templates/index.php ) 您可以在index.php(/templates/your_templates/index.php)中查看这些文件。

That link you have posted is about creating a component (nothing to do with templates), also is impossible to upload CSS and JS files through the media uploader , first of all the files are uploaded by default in /images/ folder, secondly I am not quite sure how is it possible to work. 您发布的链接是关于创建组件的(与模板无关),也无法通过媒体上载器上载CSS和JS文件,首先默认情况下将所有文件上载到/ images /文件夹中,其次是不太确定如何工作。

BUT there might be a tricky solution for your problem. 但是可能有一个棘手的解决方案来解决您的问题。 Each component, module or plugin is able to embed its own styles and Javascript files. 每个组件,模块或插件都可以嵌入自己的样式和Javascript文件。 Take a look at your template's source code, there must be a line like this 看一下模板的源代码,必须有这样一行

<jdoc:include type="head" />

This mentions to the joomla core that there will be embedded the additional files in the head of the HTML document. 这向joomla核心提到,将在HTML文档的头部嵌入其他文件。 My approach would be presented four generic steps 我的方法将介绍四个通用步骤

a) Create a folder where your client can upload several CSS and JS files b) Create a plugin in order to do the uploaded stuff c) In your plugin implementation add some functionality for editing the files (you can use any jquery's editor plugin to display the code in a popup or even joomla default editor d)allow user to choose which files wants to embed a)创建一个文件夹,您的客户端可以在其中上传几个CSS和JS文件b)创建一个插件以执行上传的内容c)在您的插件实现中,添加一些用于编辑文件的功能(您可以使用任何jquery的编辑器插件来显示弹出式窗口甚至joomla默认编辑器中的代码d)允许用户选择要嵌入的文件

As I can imagine it will be a very hard task to accomplish since you have to face lots of problems (file uploading restrictions, file rights etc) but it's not impossible to do 我可以想象,这将是一项非常艰巨的任务,因为您必须面对很多问题(文件上传限制,文件权限等),但这并非不可能

Good luck with your project 祝您项目顺利

在回答了您之前关于基本相同问题的问题之后,我将再次说一遍,您可以下载文件上传器组件,该组件为我提供了链接,或者只是从JED下载文件管理扩展。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM