magento 底部社交账号图标不显示问题修复

文章目录

    问题现象

    在首页,网站底部的社交账号图标能正常显示。

    magento 图片显示正常

    但是到了其他子页面,这些图标就不显示了。

    magento 图片显示不正常

    对比了一下链接,确实有区别:

    • 第一个链接是可以显示的链接
    • 第二个链接是无法显示的链接
      https://www.sunzhongwei.com/skin/frontend/default/sunri_1/images/slider/LinkedIn1.png https://www.sunzhongwei.com/skin/frontend/base/default/images/slider/LinkedIn1.png

    问题 block 代码

    <div>
    <p><span> <a href="https://www.linkedin.com/company/sunricher/posts/" target="_blank"><img src="{{skin url="images/slider/LinkedIn1.png"}}" alt="Linkedin" width="25" height="25" />&nbsp; &nbsp;</a><a href="https://www.facebook.com/SunricherController/" target="_blank"><img src="{{skin url="images/slider/Facebook1.png"}}" alt="Facebook" width="25" height="25" />&nbsp; &nbsp;</a><a href="https://www.tiktok.com/@sunricher/" target="_blank"><img src="{{skin url="images/slider/TikTok1-25x25dpi.png"}}" alt="TikTok" width="25" height="25" />&nbsp; &nbsp;</a><a href="https://www.youtube.com/@Sunricher" target="_blank"><img src="{{skin url="images/slider/YouTube1.png"}}" alt="YouTube" width="25" height="25" />&nbsp; &nbsp;</a><a href="https://www.instagram.com/sunricher_controller/" target="_blank"><img src="{{skin url="images/slider/Instagram1.png"}}" alt="Instagram" width="25" height="25" />&nbsp; &nbsp;</a><a href="https://x.com/sunricher/" target="_blank"><img src="{{skin url="images/slider/XTwitter-25x25.png"}}" alt="Twitter" width="25" height="25" />&nbsp; &nbsp;</a></span></p>
    </div>
    

    修复后的代码

    <div>
    <p><span> <a href="https://www.linkedin.com/company/sunricher/posts/" target="_blank"><img src="/skin/frontend/default/sunri_1/images/slider/LinkedIn1.png" alt="Linkedin" width="25" height="25" />&nbsp; &nbsp;</a><a href="https://www.facebook.com/SunricherController/" target="_blank"><img src="/skin/frontend/default/sunri_1/images/slider/Facebook1.png" alt="Facebook" width="25" height="25" />&nbsp; &nbsp;</a><a href="https://www.tiktok.com/@sunricher/" target="_blank"><img src="/skin/frontend/default/sunri_1/images/slider/TikTok1-25x25dpi.png" alt="TikTok" width="25" height="25" />&nbsp; &nbsp;</a><a href="https://www.youtube.com/@Sunricher" target="_blank"><img src="/skin/frontend/default/sunri_1/images/slider/YouTube1.png" alt="YouTube" width="25" height="25" />&nbsp; &nbsp;</a><a href="https://www.instagram.com/sunricher_controller/" target="_blank"><img src="/skin/frontend/default/sunri_1/images/slider/Instagram1.png" alt="Instagram" width="25" height="25" />&nbsp; &nbsp;</a><a href="https://x.com/sunricher/" target="_blank"><img src="/skin/frontend/default/sunri_1/images/slider/XTwitter-25x25.png" alt="Twitter" width="25" height="25" />&nbsp; &nbsp;</a></span></p>
    </div>
    

    skin url 与 media url 的区别

    • media url 是产品图片等
    • skin url 是静态资源文件,如 static 下的图片 js 或 css

    关于作者 🌱

    我是来自山东烟台的一名开发者,有感兴趣的话题,或者软件开发需求,欢迎加微信 zhongwei 聊聊,或者关注我的个人公众号“大象工具”, 查看更多联系方式