简体   繁体   English

在Joomla中打开页面

[英]Open page in Joomla

I'm using Jumi to echo php code and then showing that in a Joomla Article, and everythings working fine. 我正在使用Jumi来回显php代码,然后在Joomla文章中进行演示,一切正常。 Now I want to do this: 现在我要这样做:

The output is basically a list from a database like this: 输出基本上是这样的数据库列表:

Name    Price    Type
A       1        T1
B       2        T2

In this list I want to include links to only show items of the same type, so "T1" would like to a page only showing things of type T1. 在此列表中,我希望包含仅显示相同类型项目的链接,因此“ T1”希望显示仅显示T1类型内容的页面。 So I thought I would do this by making a new page that takes a type and then get all the items of that type from the database. 因此,我想我可以通过制作一个新的页面来实现该目的,该页面采用一种类型,然后从数据库中获取该类型的所有项。 Without Joomla this wouldv'e been a piece of cake, with Joomla I'm not quite sure where to begin. 没有Joomla,这简直是小菜一碟,有了Joomla,我不太确定从哪里开始。

How should the a href=... tags in the html code printed by my php script look? 我的php脚本打印的html代码中的a href = ...标签应该如何显示?
Is my basic structure still correct, and if so, how do I make Joomla open the new page in the normal frame and not replace the whole Joomla page. 我的基本结构是否仍然正确,如果是,我如何使Joomla在常规框架中打开新页面而不替换整个Joomla页面。 some kind of target-frame attribute? 某种目标框架属性?

EDIT: 编辑:
I know I should be using a component instead, however I just need to get this working before going on vacation in three days. 我知道我应该改用一个组件,但是我只需要在三天后去度假就可以使它工作。 I will do it properly when I get back. 我回来的时候会做的很好。 I don't mind if the entire page reloads, what I do need is the Joomla menu, header-banner and other things around the page to be loaded as well. 我不介意整个页面是否重新加载,我需要的是Joomla菜单,标题横幅以及要加载的页面周围的其他内容。 If I just use a href=mypage.php I assume the header and everything around it will disappear. 如果我仅使用href = mypage.php,则假定该标头及其周围的所有内容都将消失。

I think you are going about this all wrong. 我认为您要解决所有这些错误。 You shouldn't be using Jumi to run php in your articles. 您不应该在文章中使用Jumi运行php。 You should design a component. 您应该设计一个组件。 Although this will take a tiny bit longer to setup initially it will save you time in the long run and prove to be much more flexible than using Jumi in a single article. 尽管最初设置需要花费一点时间,但从长远来看,它可以节省您的时间,并且比单篇文章使用Jumi更加灵活。 Have a look here on how to create a Joomla component - http://www.joomladevuser.com/tutorials/components . 在这里了解如何创建Joomla组件-http: //www.joomladevuser.com/tutorials/components

a href= tags should not be any different from any other html you have ever used. href =标记应该与您使用过的任何其他html都没有任何不同。

Eg echo '<a href="http://.....">link</a>'; 例如echo '<a href="http://.....">link</a>';

To make just the frame/div/table/etc reload rather than the entire page you will need to implement some AJAX. 要仅重新加载frame / div / table / etc而不是整个页面,您将需要实现一些AJAX。 I have answered a question on how to do this with Joomla components before, see here: how to use Jquery AJAX in Joomla Components? 我之前已经回答过有关如何使用Joomla组件执行此操作的问题,请参见此处: 如何在Joomla组件中使用Jquery AJAX?

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

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