Module importing
Created 7 years ago by minkyovCan I create a module and then call it from inside a page? For example I create the module sponsors and I want to add it to the home page of my website as a section in the end of the page. Thanks!
jcastillotx
—
7 years ago
What I do is call it via Twig for function:
{% for entry in entries('stream').get() %} {{entry.whatever}} {% endfor %}
You can also add limits and where statements. Also you can do a plugin via Twig functions.
minkyov
—
7 years ago
Thank you I needed the view of the module {% include "anomaly.module.gallery::gallery/index" %} worked exactly as needed!
ryanthompson
—
7 years ago
Be sure to mark the answer 😊
Of course! If you just need data you can get it with the
entries
function or if you need a view you can reference it with it's namespace likeexample.module.sponsors::your/view
using Twig'sinclude
feature.Hope this helps!