Slideshow_XH

Third Party Plugins to CMSimple - how to install, use and create plugins

Moderator: Tata

Post Reply
Tata
Posts: 3587
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Slideshow_XH

Post by Tata » Thu Oct 06, 2016 10:38 pm

Is there a way how to add a background to the slideshow? If so, what is the correct path to e.g. ./userfiles/images/slideshow/background.jpg? May the background be defined in e.g. template/stylesheet.css?
So far there is one slide replaced by an empty container.
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

lck
Posts: 2967
Joined: Wed Mar 23, 2011 11:43 am
Contact:

Re: Slideshow_XH

Post by lck » Fri Oct 07, 2016 12:31 pm

Create folder and file: ./plugins/slideshow/css/stylesheet.css with content:

Code: Select all

.slideshow_1_container {
    background: url(../../../userfiles/images/slideshow_1/background.jpg) 50% 50% no-repeat #333;
    background-size: cover;
    width: 100%;
}

#slideshow_1 {
    border: 50px solid transparent;
    box-sizing: border-box;
} 
or in your template stylesheet.css

Code: Select all

.slideshow_1_container {
    background: url(../../userfiles/images/slideshow_1/background.jpg) 50% 50% no-repeat #333;
    background-size: cover;
    width: 100%;
}

#slideshow_1 {
    border: 50px solid transparent;
    box-sizing: border-box;
} 
In a site:

Code: Select all

<div class="slideshow_1_container">{{{slideshow('slideshow_1');}}}</div>
Or accordingly to the template.
„Bevor du den Pfeil der Wahrheit abschießt, tauche die Spitze in Honig!“   👉 Ludwig's XH-Templates for MultiPage & OnePage

Tata
Posts: 3587
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: Slideshow_XH

Post by Tata » Fri Oct 07, 2016 3:28 pm

Thanks, it works.
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

Tata
Posts: 3587
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: Slideshow_XH

Post by Tata » Sat Oct 08, 2016 6:44 am

Well, the only way of solving the slideshow appearence was use of viewport units "vw, vh". See the result at http://ukastelana.cmsimple.sk and test it with any device or device emulator.
Adwantage is that I can use the unit "vw" - ViewportWidth both for the width and height element and thus keep the aspect ratio of an image.
e.g. The image of 800x600 has the aspect ratio equal 4:3. Using the viewport units can be set based on the width.
1vw = 1% of ViewportWidth
If I am depending on the width of my alocated design space, I set

Code: Select all

.img{
width: 80vw; /* 80% of ViewportWidth */ 
height: 60vw; /* height respecting the image aspect ratio 3:4 */
} 
If I am depending on the height of my alocated design space (almost never), I can set

Code: Select all

.img{
height: 60vh;  /*  60% of ViewportHeight */
width: 80vh    /* width respecting the image aspect ratio 3:4*/
}
There is still a way to combine these units with their alternatives - browsers not understanding

There is only one disadvantage of these units - they are not supported by all browsers. Read more http://caniuse.com/#search=viewport%20units.
But considering the percentage of accepting browsers use, I probably will step into the line of supporters, who try to learn visitors to keep up with new versions of browsers, instead of wasting time by making stylesheets for dinosauria browsers. I am often called by colleagues to show them this and that on their computers and I see how lazy or incompetent they are in keeping installed software up-to-date. Some applications don't necessary need any update. But browsers are mostly worth to keep up.
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Slideshow_XH

Post by cmb » Sat Oct 08, 2016 8:40 am

Tata wrote:Well, the only way of solving the slideshow appearence was use of viewport units "vw, vh".
Please try without these additions, but this fix for Slideshow_XH.
Christoph M. Becker – Plugins for CMSimple_XH

Tata
Posts: 3587
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: Slideshow_XH

Post by Tata » Sat Oct 08, 2016 12:56 pm

Ich versuche es local, weil ich schon das ganze bereits fertig habe, nur noch einige Übersetzungen und die Speisekarten aktualisieren. Ich musste aber die Tempmlates für jede einzelne Seite einstellen. Im content.htm war es eigentlich ganz einfach. Jetzt ist die Seite hochgeladen.
Nur ein winziges Bug habe ich im stzlesheet - einige Links zeigen die Rahmung doppelt ung bei Bilder (Newsboxe im footer) ist eine der Rahmung nur 1 Zeile hoch. Ist aber keine Ursache.
Vielen Dank an alle, die mir mit den Rätsel geholfen haben. Wieder etwas zugelernt. Noch einige Jahre und ich werde ein gute Anfänger :-).
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

Post Reply