1

I'm trying to get my head around Joomla 3.2's new framework and develop a capability/feature in a custom component (lets call it com_custom) that can load com_content's category blog view within com_custom's view, using the category blog's menu item id!

There are quite a few codes that I saw here and around the web that only load the default view of the 'imported' component, rather than the view specified in the imported component's assigned menu parameters. Also, most of these codes use deprecated functions, so I'm quite lost now.

So what I need to be able to add is:

  1. Include a category blog view (say from menu item id 223) within com_custom's current view.
  2. It should import all of the parameter setting of the category blog's menu item.
  3. It should not be in an iFrame

Any help is much appreciated!!!

web-tiki
  • 99,765
  • 32
  • 217
  • 249
Jamin
  • 11
  • 1

1 Answers1

0

You can't include com_content because it makes use of the JPATH_COMPONENT constant in 14 different places, most notably in content.php (the main file that's loaded, even before the controller) and in most views, in order to load helpers.

These are the first two ways that come to mind to overcome this limitation:

  1. Instantiate the articles model, load the data, and use your view to display it; you'll need to dig into the menu table to find the params related to your menuid; Bewre: Search engines might consider the duplicate content as spam.

  2. Insert a jquery ajax call to get the url of the menuid adding &tmpl=component i.e.

    index.php?option=com_content&view=category&id=13&Itemid=522&tmpl=component

The latter will be much easier to implement. Search Engines will NOT see the different content under different urls, since it's ajax.

Regarding the limitation, see also this question: Joomla how can i create model from other component

Community
  • 1
  • 1
Riccardo Zorn
  • 5,590
  • 1
  • 20
  • 36