Only an idea

About the template and stylesheet - and changing the menu
cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Only an idea

Post by cmb » Mon Oct 03, 2016 10:21 pm

Tata wrote:There are nowsboxes above the content. So jumping to the content would be very helpful.
IMHO: if the content should be displayed first, put the newsboxes and the menu below the content. It seems to me that this generally offers better user experience (usually, you do not scroll up unless you have scrolled down before).
Christoph M. Becker – Plugins for CMSimple_XH

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

Re: Only an idea

Post by Tata » Tue Oct 04, 2016 6:48 am

I know about this. But On WIde screens it make no problem. I think those using smartphones or tablet, use then mostly for the "Daily menu", which is the very first newsbox in the left column with one more important infobox below. The next column The navigation with another infobox below (just to keep the column of about the same height as the first one - to fill better the screen on tablets) floats right. These two columns tahe about 50% of wide screen width. The rest is used for content column.
Again - on wider screens it's OK. On narrower screens howerer, the "daily menu" and navigation are logical placed first. But there's no hint to scroll down to read further content (this seems to be the easiest solution - to place/show the notice depending on media-querry). To jump automatically to desired page headding would be very effective. In this case a floating "TOP" link would be placed or z-index-fixed at page bottom.
I am not sure how to modify the TOC or menu function. But it won't hurt on wide screens, if the function would generate an anchor for each generated heading and adressing each "menuitem... li-$id" to its respective anchor. The advantage would then be automaticaly scrolling to the desired content on narrower screens. I think this would solve a lot of designers' problem. Especially if the page has (except of standard content) the content changed frequently, which shall be accessible immediately at opening the page.

See the screenshots
[ external image ] [ external image ] [ external image ] [ external image ] [ external image ]
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: 3586
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: Only an idea

Post by Tata » Tue Oct 04, 2016 7:30 pm

How about this.

Each page has one unique value in the content.htm - it is e.g. last_edit. This may change, of course, but it will be always in data array of the very specific page.
It sould be then used in generetaed menu item link. So clicking the menu item, this value would be used as the anchor. It would not hurt on pages that don't need it. But it would help by templates where from whatever reason the content is placed below the bottom screen limit (e.g. on pages where the banner takes to high space or even the full screen with the horizontal navigation on top).
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: Only an idea

Post by cmb » Tue Oct 04, 2016 9:21 pm

I don't think that we should link to anchors (at least not by default, and probably not with the basic CMSimple_XH at all), especially not if these anchors are likely to change – consider SEO, for instance.

And actually, I'm not sure whether you really want to link to a different anchor for each page. At least, when I read your former posts in this thread, it occurred to me that you want to link all/most pages to the same anchor set in the template.

Either way, this could be done by a plugin and would fit quite nicely to Toxic_XH.
Christoph M. Becker – Plugins for CMSimple_XH

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

Re: Only an idea

Post by Tata » Wed Oct 05, 2016 5:40 am

One thing is true - I have not consider SEO.
And maybe the very website is to specific - the "basic textual content" is not as important as the daily menu and the TOC. 90% of visitors look for dailz menu. The rest eventually for TOC and the rest content. So I have adjusted the design to these needs.
Will try the Toxic.
Thanks.
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: 3586
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: Only an idea

Post by Tata » Wed Oct 05, 2016 9:44 am

Another problem occured.
I use a simple timer script on the page. It worked fine and I just wanted to adjust it a little, removing all variables from th e template. But something went wrong and I can't find the bug. The function is simpmle:
1. till 09:30 show message "$tx['template']['text5']"
2. from 09:30 - 13:30 show the Newsbox
3. after 13:30 show message "$tx['template']['text6']"
Now I see only the "$tx['template']['text5']".
I created the variables and moved the values to language file:

Code: Select all

$tx['template']['show_time']="09:30";
$tx['template']['hide_time']="+210 minutes";
$tx['today']['dateformat']="l, d.m.Y";
$tx['today']['timeformat']="H:i";
and changed the template:

Code: Select all

<div class="heading">DENNÉ MENU
                         <div class="day-time">
                             <?php     
                                   setlocale(LC_ALL, 'sk_SK');
                                   echo strftime("%A, %e. %B %Y");
                                   $time = time();
                                   $showTime =  $tx['template']['show_time'];
                                   $hideTime = strtotime("+90 minutes", strtotime($showTime));

                                   $day= strftime("%d");
                                   $month = strftime("%m");
                              ?>
                              <?php echo date($tx['today']['dateformat']);?>
                         </div>
                    </div>
                    <div class="in">
                         <?php 
                              if ($time < $showTime) {
                                   echo '
                                   <div align="center">'.$tx['template']['text5'].'</div>';
                              } elseif ($time > $showTime && $time < $hideTime) {
                                   echo '
                                   <div align="left">'.newsbox('Denné menu').'</div>';
                              } else {
                                   echo '
                                   <div align="center">'.$tx['template']['text6'].'</div>
                                   <div style="text-align:center">'.($day+1).'. '.$month.'. o 10:00</div>';
                              }
                         ?>
                    </div>
I went trough all possible manuals on the internet and tried to make it working. But it doesn't work. The localisation doesn't work either. The daynames remain in English.
Can somebody give me a lecture?
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: Only an idea

Post by cmb » Wed Oct 05, 2016 11:27 am

Tata wrote:But something went wrong and I can't find the bug.
The comparison between $time and $showTime doesn't work, because the former is a Unix timestamp (i.e. an integer number) and the latter is a time string ("09:30"). So you have to replace these lines:

Code: Select all

                                  $showTime =  $tx['template']['show_time'];
                                   $hideTime = strtotime("+90 minutes", strtotime($showTime));
with these:

Code: Select all

                                  $showTime =  strtotime($tx['template']['show_time']);
                                   $hideTime = strtotime("+90 minutes", $showTime);
Tata wrote:The localisation doesn't work either.
Locale support is always a bit of an issue. Maybe the specified locale isn't supported; check the return value of setlocale(). You could try something like:

Code: Select all

setlocale(LC_ALL, 'sk_SK', 'sk_SK.UTF-8');
However, it's usually best not to use setlocale() at all in CMSimple_XH plugins and templates, but to set the respective language string.

And as locales are not thread-safe, there still may be issues on multi-threaded servers, so it's probably best to use the IntlDateFormatter class, which doesn't suffer from this issue, if it is available.
Christoph M. Becker – Plugins for CMSimple_XH

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

Re: Only an idea

Post by Tata » Wed Oct 05, 2016 3:20 pm

Thanks, Chris. The first part of your hint workes fine. The rest has brought me nowhere. But I have found another sollution (a littl primitive, but working anyway)

Code: Select all

                             <?php
                                setlocale("%a %e. %B %Y, %H:%M");
                                //REPLACE ENG DAYNAMES
                                $day_name=array('Nedeľa','Pondelok','Utorok','Streda','Štvrtok','Piatok','Sobota');
                                // CEATE SLOVAK DATE FORMAT
                                echo $day_name[date('w')];   
                                echo strftime("%e. %B %Y");
                                $time = time();
                                $showTime =  strtotime($tx['template']['show_time']);
                                $hideTime = strtotime("+90 minutes", $showTime);
                                $day= strftime("%d");
                                $month = strftime("%m");
                              ?>
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: Only an idea

Post by cmb » Wed Oct 05, 2016 4:35 pm

Tata wrote:But I have found another sollution (a littl primitive, but working anyway)
Ah, yes, this is of course fine, see also https://web.archive.org/web/20140104123 ... customized.
Tata wrote:The rest has brought me nowhere.
I never worked with IntlDateFormatter (and only very little with the intl extension in general), so I can't easily present a working solution. But as you already have one, I guess that's okay. :-)
Christoph M. Becker – Plugins for CMSimple_XH

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

Re: Only an idea

Post by Tata » Wed Oct 05, 2016 5:45 pm

Yes, it's fine so far. Still trying to remove everything editable from the template. And trying to understand differdnces in syntax. Though, to old to learn al those new things.
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