2

I had followed this basic tutorial and successful created new menu type name "hello world" with 2 views inside "tmpl" folder name "default.php" & "other.php"

Menu.

Problem

The problem here is, I wanted to create 2 different views with different content inside each view. But both of 2 files "other.php & default.php" are point to com_helloworld/helloworld.php with same content in helloworld.php file. I tried to search for solution several hours but unable to find a solution for this issue. Please advise how to point out the "other.php" file in tmpl folder to different file instead of current "helloworld.php" file :(

closed as too broad by FFrewin, Nagarjun, Lodder, Sahil Purav, Dmitry Rekun May 27 '15 at 14:06

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • Hello SonDang, I feel your question is too broad and it will be hard to get a thorough answer. I would suggest to read more about developing components and the MVC pattern. You can find more resources here: joomla.stackexchange.com/questions/3579/…. If you are interested, there are a few good books about creating Joomla extensions. Just search for Joomla development books. – FFrewin May 24 '15 at 11:51
  • Thanks for the suggestion FFrewin, I will check in the resources in share for solution :( – SonDang May 24 '15 at 14:51
2

You created two layouts (stored in views/helloworld/tmpl). What you want to do is create a new view, i.e. views/other/

In the view.html.php file therein you can invoke the same or a different model to get the data you want. Look at the code of some simple components like com_users to get a feel of how it's done, or read the docs.

Not the answer you're looking for? Browse other questions tagged or ask your own question.