heart-bits/contao-article-backgrounds-bundle

文章背景/Contao开源CMS的辅助扩展

2.0.0 2024-08-05 12:48 UTC

This package is auto-updated.

Last update: 2024-09-07 10:20:00 UTC


README

这个Contao扩展允许后端用户为每篇文章设置独立的背景图片,甚至可以添加带有颜色的文章分隔符。

分隔符/多边形可以通过在templates/polygons/polygon-[polygon_style].php下的文件中添加。 [polygon_style]指的是翻译数组,目前包括"top","right","bottom","left"和"cross"。选定的颜色也可以通过<?= \Input::get('color') ?>在多边形模板中获取。这样,例如,一个svg文件可以通过后端轻松着色。

该扩展不提供任何CSS!因此,定位必须手动完成(见以下示例)。

.mod_article {
    position: relative;
}

.mod_article > .article-image {
   position: absolute;
   z-index: 1;
   top: 0;
   left: 0;
   width: 100%;
   height: 100%;
   overflow: hidden
}

.mod_article > .inside {
   position: relative;
   z-index: 3;
}

.mod_article > .article-image.float-right {
   left: auto;
   right: 0;
   width: 50%
}

.mod_article > .article-image.float-left {
   left: 0;
   width: 50%
}

.mod_article > .article-image .image_container,
.mod_article > .article-image picture {
   position: absolute;
   top: 0;
   left: 0;
   width: 100%;
   height: 100%
}

.mod_article > .article-image .image_container img,
.mod_article > .article-image picture img {
   position: absolute;
   top: 50%;
   left: 50%;
   max-width: none;
   min-width: 100%;
   min-height: 100%;
   width: auto;
   height: auto;
   -webkit-transform: translate(-50%, -50%);
   transform: translate(-50%, -50%)
}