Only an idea

About the template and stylesheet - and changing the menu
Tata
Posts: 3626
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: Only an idea

Post by Tata » Sat Oct 28, 2017 3:59 pm

INstead of refactoring the template I tried to hide the "welcome screen" with

Code: Select all

<div id="welcome_screen" class="<?php if(!$adm || !$edit) {echo $intro;} else {echo 'intro_hide';}?>">
Having "intro_hide" set to display:none in stylesheet, I assumed:
1. if the page is not in admin/edit modus, the welcome screen is on (this works fine, logging in, the newsboxes disappear).
2. there $intro = "intro" defined on the first (empty) page will show the 4 newsboxes and
3. any other page without defined $intro will hide them. But this doesn't work. The newsboxes are always there.
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: 14227
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Only an idea

Post by cmb » Sat Oct 28, 2017 4:33 pm

Tata wrote:INstead of refactoring the template I tried to hide the "welcome screen" with

Code: Select all

<div id="welcome_screen" class="<?php if(!$adm || !$edit) {echo $intro;} else {echo 'intro_hide';}?>">
Having "intro_hide" set to display:none in stylesheet, I assumed:
1. if the page is not in admin/edit modus, the welcome screen is on (this works fine, logging in, the newsboxes disappear).
2. there $intro = "intro" defined on the first (empty) page will show the 4 newsboxes and
3. any other page without defined $intro will hide them. But this doesn't work. The newsboxes are always there.
This can't work, since there is no query regarding $intro. Furthermore, why hiding the newsboxes instead of not emitting them in the first place? So, I think a better solution would be to use a variation of Newsbox on the start page only; something like:

Code: Select all

<?php if (!(XH_ADM && $edit) && $s == 0):?>
<!-- emit the newsboxes -->
<?php endif?>
Christoph M. Becker – Plugins for CMSimple_XH

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

Re: Only an idea

Post by Tata » Sat Oct 28, 2017 5:04 pm

Simply genie!
It works excellently with standard template. With onepage template the first (empty screen is there).
Mod is uploaded.
I see, however, that with the same content only one of the templates (standard/onepage) can be used. Internal links made under one template are wrongly interpreted under the onepage template. But that's no problem. Only one of them will finally be used.
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