4

I have custom component and plugins and listing some details in table after click on the table i'll go to details page. i want show the one of details in article, so i created a custom plugins and got the id of the details, but i dont know how to call the details view in plugins.

1 Answer 1

6

From joomla 3.0 onwards a layout sharing feature is introduced, using it you can call a layout across views or extensions. It requires creating a layout object and then render the view using that object as:

$layout = new JLayoutFile('my_layout', $basePath = JPATH_ROOT .'/components/com_something/layouts');
$html = $layout->render();

this will render the 'my_layout.php' layout file found in JPATH_ROOT .'/components/com_something/layouts' directory. So you can try the above code in your plugin to call your component view if you are using joomla 3.0+

For more details check this page :- https://docs.joomla.org/Sharing_layouts_across_views_or_extensions_with_JLayout

2
  • Thk it working. one more thing if possible to view product details virtuemart like this ?
    – SAM
    Commented Jul 6, 2015 at 7:36
  • I don't use Virtuemart, but if it follows Joomla's standard then you can override its default layout to supports JLayout. Here are some useful articles: docs.joomla.org/… and docs.joomla.org/Understanding_Output_Overrides
    – Hung Tran
    Commented Jul 9, 2015 at 17:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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