I have edited the announcements plugin and create a new plugin using image cards. For this I have also created the mobile support. This plugin works as expected in the mobile app when Moodle is hosted locally and connected from phone via Wifi/LAN.
But as soon as the plugin is uploaded to the server something went wrong and the images aren’t loading inside the image tags.
When inspected using Chrome developer tools, the image tag has the URL. When copy pasting the URL the browser is able to access the correct image that is in the card’s img tag.
https://moodle.org/mod/forum/discuss.php?d=458703
for images and other details you can check this link
This happens only in the Mobile app, the plugin works well in the broswer. This is the code I have written for the mustache template in the plugin’s mobile support:
{{=<% %>=}}
{{ ‘plugin.block_s2s_announcements.greetings’ | translate }}
<div class="card mb-3" core-site-plugins-new-content component="block_s2s_announcements" method="form_s2s_announcements"
[args]="{subject_arg: '<% subject %>',post: '<% posttime %> ', time: '<%timerecent %>', name:'<% username %>',img:'<%img%>'}"
style=" border-style: solid; margin-bottom:10px; margin: 10px;">
<div class="card-img-top" style="height: 300px; width: auto; overflow: hidden;">
<img src="<%img%>" style="width: 100%; height: 100%; object-fit: cover;">
</div>
<div class="card-body" style="margin:10px;">
<h2> <% subject %></h2>
<div class="d-flex justify-content-between" style="display:flex; justify-content:between;">
<p class="card-text"><small class="text-muted"><% posttime %> | <%timerecent %></small></p>
<p class="card-text" style="text-align: right; margin-left: auto;"><small class="text-muted"><% username %></small></p>
</div>
</div>
</div>
<%/messages%>
I have also tried sudo chmod -R 755 for the Moodle root folder still nothing wrong.
Kindly help me solve this problem.
Thanks!
I tried modifing image area to see if the problem is related to back end but still the img was not showing in moodle application when it load from server.But while loading ffrom local host it was fine and i also change the permission of the file to check if their any problem related to permission but none of this seems to be the problem if you have any new suggection can you please share it with me
SHYAM KUMAR B is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.