1

I have been following this guide to successfully create a Joomla custom component: http://docs.joomla.org/J2.5:Developing_a_MVC_Component/Introduction

For simplicity's sake lets say I have two tables, one for authors and one for books.

--AUTHORS-- ID Name

--BOOKS-- ID Name Author_reference

Both have two views each, one list view and one edit view. When I click on a author in the list view it takes me to the list view of the books to see what books the author has written, and only those books filtering out the others.

Here the problem start, when I click on the New button in Joomla I want to add a book to that specific author, but have no way to set that reference. So far I have set that reference with a Session variable when clicking the author but that has obvious flaws such as opening another author in a new tab changing the Session variable.

EDIT: Looks like my question was not very specified. I need a way to send a parameter/variable when clicking the "New" button in admin mode in my component.

4

2 回答 2

0

您可以使用Joomla Component Creator中的“外键”或“类别字段”功能来构建它。它将为您节省很多麻烦。试试看。

于 2013-07-31T14:28:35.220 回答
0

您可以在我回答的另一个问题上看到一个很好的教程:如何添加链接 category_id 添加到管理员 (JToolBarHelper::addNew)?- Joomla 2.5

基本上,joomla 有两个功能,您可以在控制器中为该视图设置这些功能,以方便将项目添加到 url,即使它是作为加载、签出和保存过程的一部分的重定向。

于 2013-07-31T00:38:47.347 回答