将维护页面添加到 hybris cloud - 如何显示图像和 css?
Adding maintenance page to hybris cloud - how to show images and css?
我们一直在尝试通过云门户将维护页面上传到我们的站点。我们一直在sap help cloud portal上关注this tutorial,文件结构如下,压缩为zip文件,添加到静态文件中;
error.zip
error
┣ 503.html
┣ img1.jpg
┣ img2.png
┣ assets
┣┗ style.css
问题是,当我在我们的一个 JS 店面中使用静态文件作为维护页面并激活维护模式时,它既看不到图像,也看不到文件中的 css。
我之前在我们的另一个项目中做过这个,并且必须将图像转换为 base64 格式并在 html 文件中使用内部 css 作为图像和样式的解决方法正确显示。
是否有其他方法或特定的文件命名约定必须使用才能使图像在没有 base64 转换的情况下工作,并将 css 用作外部文件?
我们使用的是 hybris 2005
我对图片有同样的问题。它们不适用于 hybris 6.7.0 中的维护页面。确保使用正确的 src
<img src="/error/img2.png"/>
在我的例子中,我忘记在图像名称前添加 /error/。添加它解决了我的问题
结构似乎是正确的,请检查您是如何引用 css 和 img.
<html>
<head>
<title>Maintenance</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="error/css/style.css" type="text/css">
</head>
<body>
<div class="block">
<div class="block-img">
<img src="error/img/back-soon-img.jpg" alt="My test image" class="img" />
</div>
<div class="block-text">
<img src="error/img/back-soon-text.jpg" alt="My test image" class="img" />
</div>
</div>
<div class="hidden">
<h1>Maintenance</h1>
<p>Our site is temporarily offline but we'll be back shortly, looking better than ever.</p>
</div>
</body>
</html>
文件和文件夹结构:
我们一直在尝试通过云门户将维护页面上传到我们的站点。我们一直在sap help cloud portal上关注this tutorial,文件结构如下,压缩为zip文件,添加到静态文件中;
error.zip
error
┣ 503.html
┣ img1.jpg
┣ img2.png
┣ assets
┣┗ style.css
问题是,当我在我们的一个 JS 店面中使用静态文件作为维护页面并激活维护模式时,它既看不到图像,也看不到文件中的 css。
我之前在我们的另一个项目中做过这个,并且必须将图像转换为 base64 格式并在 html 文件中使用内部 css 作为图像和样式的解决方法正确显示。
是否有其他方法或特定的文件命名约定必须使用才能使图像在没有 base64 转换的情况下工作,并将 css 用作外部文件?
我们使用的是 hybris 2005
我对图片有同样的问题。它们不适用于 hybris 6.7.0 中的维护页面。确保使用正确的 src
<img src="/error/img2.png"/>
在我的例子中,我忘记在图像名称前添加 /error/。添加它解决了我的问题
结构似乎是正确的,请检查您是如何引用 css 和 img.
<html>
<head>
<title>Maintenance</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="error/css/style.css" type="text/css">
</head>
<body>
<div class="block">
<div class="block-img">
<img src="error/img/back-soon-img.jpg" alt="My test image" class="img" />
</div>
<div class="block-text">
<img src="error/img/back-soon-text.jpg" alt="My test image" class="img" />
</div>
</div>
<div class="hidden">
<h1>Maintenance</h1>
<p>Our site is temporarily offline but we'll be back shortly, looking better than ever.</p>
</div>
</body>
</html>
文件和文件夹结构: