0

I've built my own component com_mycomp and in the component there is form in a layout and the path to this layout is: com_mycomp/site/layouts/subscription/form.php

so I want to show this layout (form) in an article so I need to build a module to do the job for me, right?

my Question:

  • can I load the layout in the module?
  • I've also tried to build a view to show the layout but I also can't load the view in the module, any thoughts?

P.S. I don't want to use an external module or plugin

7
  • You can create a module and add it to an article using the editor. You can use the same field as you used in the layout and use the same table (if you use database). Apr 28 '20 at 13:39
  • 1
    @ThiagoGuimarães (this is not a gumpy message) Your comment does not seek clarification of question details -- it is providing a possible resolution. Comments should not attempt to provide a resolution. To post resolving advice, please post an answer. If you are not confident about your resolving advice, please phrase your comment to ask something of the OP -- this is a minor re-wording of your comment. e.g. "Do you know how to add a module into an article? Have you seen this? docs.joomla.org/How_do_you_put_a_module_inside_an_article%3F" Be careful to ask (not tell) in comments.
    – mickmackusa
    Apr 28 '20 at 21:43
  • @Trolli So you don't want this? joomlashack.com/blog/joomla/loadposition-loadmodule
    – mickmackusa
    Apr 28 '20 at 21:44
  • @mickmackusa sorry if my question was not clear, I know how to load module in an article. I want to know to load a layout component or a view in the module :) Apr 29 '20 at 6:23
  • @TrolliFlame Welcome to JSE just the same. Please take our tour to begin to familiarise yourself with our community.
    – mickmackusa
    Apr 29 '20 at 6:25
1

I would program a custom module for this purpose.

In its helper file I would load the Model of your component to retrieve the items that you will display.

Check out a Joomla core module like /modules/mod_articles_latest to see how it re-uses Joomla's ContentModelArticles.

In the /tmpl/default.php I would put the html + php to display the data. As basis I would copy parts of the components html output.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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