如何将新页面添加到 Joomla 管理面板 [英] How to add a new page to Joomla Admin panel

查看:10
本文介绍了如何将新页面添加到 Joomla 管理面板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 Joomla 的新手.我需要在 Joomla 管理面板(不是在主站点上)中添加一个新的自定义 PHP 页面,以显示我自己表中的一些数据.我的 Joomla 版本是 3.4.1 稳定版.

I'm new to Joomla. I need to add a new custom PHP page inside Joomla admin panel (not on the main site) to display some data from my own tables. My Joomla version is 3.4.1 Stable.

请帮帮我.

谢谢.

推荐答案

可能能够注入一个页面来显示数据 - 但我认为你最好的选择(做它正确而无需黑客攻击)可能是开发一个小组件来最好地处理它.

You might be able to inject a single page to display the data - but I think more than likely your best bet (to do it properly without hacking stuff) might be to develop a small component to handle it best.

通过创建管理组件,您可以创建您想要的页面并以您决定的方式显示您的数据.

By creating the admin component you can create the page you want and display your data however you decide.

如果没记错的话,您可以创建一个文件夹(比如 com_mycomponent)并在该目录中创建mycomponent.php".然后您将您的 php 代码添加到该页面以执行您想要的任何操作.当然,这是最基本的——准系统的想法.

If memory serves me correctly, you can create a folder (say com_mycomponent) and create 'mycomponent.php' in that directory. Then you add your php code to that page to do whatever you want. Of course, this is for the most basic - barebones idea.

我会扩展,因为据我所知,我们需要一个安装程序来实际安装"组件(尽管自从我在 Joomla 中进行大量开发以来已经有一段时间了).如果您不创建安装程序,我认为它会导致系统出错.

I will expand because to the best of my understanding we will need an installer to actually 'install' the component (although it's been a while since I've developed heavily in Joomla). If you don't create the installer I think it will cause errors within the system.

  • 创建您的目录

  • Create your directory

在目录下创建一两个目录

Create one or two directories in the directory

  • 管理员(必需)
  • 网站(可选)

在管理目录(如果你创建了站点目录)中创建mycomponent.php"并编写你想要的将代码写入管理文件(和/或)站点文件.

Create 'mycomponent.php' in the admin directory (and site directory if you created one) and write your desired code into the admin file (and/or) site file.

在 com_mycomponent 中创建mycomponent.xml"文件

Create 'mycomponent.xml' file in com_mycomponent

打开mycomponent.xml"文件并粘贴以下代码

Open 'mycomponent.xml' file and paste the below code

<?xml version="1.0" encoding="utf-8"?>
<extension type="component" version="3.4.0">
<name>Your Name</name>
<creationDate>2015-05-13</creationDate>
<author>You</author>
<authorEmail>you@example.com</authorEmail>
<description>My Joomla Component</description>
<files folder="site">
<filename>mycomponent.php</filename>
</files>

<administration>
<menu>MyComponent</menu>
<files folder="admin">
<filename>mycomponent.php</filename>
</files>
</administration>
</extension>

  • 如果您没有创建站点"目录,则可以删除以下内容:

  • You can remove the following if you did not create the 'site' directory:

    <files folder="site">
    <filename>mycomponent.php</filename>
    </files>
    

  • 压缩 com_mycomponent 下的所有内容让其命名com_mycomponent.zip

  • Zip All the contents under com_mycomponent lets name it com_mycomponent.zip

    登录到你的 joomla 管理员并安装 com_mycomponent(同样的方式你会下载任何扩展)

    Login to your joomla admin and install com_mycomponent (the same way you would any extension you download)

    安装后,您可以在以下位置查看您的页面http://yoursite.com/administrator/index.php?option=com_mycomponent

    After it installs, you can view your page at http://yoursite.com/administrator/index.php?option=com_mycomponent

    这篇关于如何将新页面添加到 Joomla 管理面板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆