This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.
Hello Guys,
I have a partial within a component which displays an image tag as follows:
<img src="{{ '/mysitefolder/plugins/author/plugin/assets/images/someimage.gif' }}" />
It's working just fine, but i need a clean way to do this. Means i don't want to type-in the complete absolute path to the image file within a plugin.
Something like <img src="{{ assets/images/someimage.gif }}" /> assuming the partial resides in the same plugin/component.
Thanks.
Last updated
May be something like twig filter "theme" :
<img src="{{ 'assets/images/someimage.gif'|theme }}" />
What if we can have something like: <img src="{{ 'assets/images/someimage.gif'|plugin }}" />
which translates the markup to: <img src="{{ '/sitefolder/plugins/author/plugin/assets/images/someimage.gif'|theme }}" />
Last updated
For backend menu pages you can do something like this:
<img src="<?= url('/plugins/author/plugin/assets/images/someimage.gif') ?>">
If would be simpler if partials in backend settings pages supported twig but they don't.
1-5 of 5