Only an idea

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

Re: Only an idea

Postby Tata » Wed Oct 05, 2016 7:45 pm

:-(
I was so thankful, proud and happy getting the code working on my localhost. After upload my joy is gone. The strings from languagefile are not shown,the times are calculated wrongly, the date format is also wrong.
Image 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.

lck
Posts: 970
Joined: Wed Mar 23, 2011 11:43 am
Location: Germany
Contact:

Re: Only an idea

Postby lck » Wed Oct 05, 2016 8:29 pm

Hello Tata,

maybe this Tutorial is helpful, or this example. Would be suitable for your purposes.
Bevor du den Pfeil der Wahrheit abschießt, tauche die Spitze in Honig ;)       ► CMSimple_XH Templates & OnePage-Templates ◄

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

Re: Only an idea

Postby Tata » Wed Oct 05, 2016 9:20 pm

I assume the problem is in PHP, not in stylesheet.It seems as if the server doesn't accept my locale setting. Wil check it later again.
Also the server cache makes me crazy. I have switched it totally off. Now it took more than an hour until some changes were shown. At least the language strings are there. But the date shows the month as a word in English.

EDIT after bad night.
OPCache was the reason again. I'll call my ISP today.
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.

frase
Posts: 1451
Joined: Thu Apr 21, 2016 6:32 am
Location: Saxony
Contact:

Re: Only an idea

Postby frase » Thu Oct 06, 2016 11:10 am

Tata wrote:I'll call my ISP today.


"call" or "kill"
;-)

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

Re: Only an idea

Postby Tata » Thu Oct 06, 2016 12:19 pm

Don't want to kill. He is nice and smart. He just hag forgotten to announce earlier new settings on the server. I called him and things work now.
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.

frase
Posts: 1451
Joined: Thu Apr 21, 2016 6:32 am
Location: Saxony
Contact:

Re: Only an idea

Postby frase » Thu Oct 06, 2016 12:30 pm

Tata wrote:He is nice and smart.

Sounds good.
"kill" was a bad joke.
:)

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

Re: Only an idea

Postby Tata » Sat Oct 28, 2017 9:51 am

cmb wrote:The best solution would be to use a customized toc(). However, it might be simpler (and also sufficient) to add some JavaScript just before the closing </body> tag:

Code: Select all

<script type="text/javascript">/* <![CDATA[ */
(function () {
    "use strict";

    var navigation = document.getElementById("navigation"),
        anchors = navigation.getElementsByTagName("a"),
        i,
        n;

    for (= 0, n = anchors.length; i < n; i += 1) {
        anchors[i].href += "#navigation";
    }
}());
/* ]]> */</script>


PS: Um, the code above jumps to the top of the navigation. To jump to the content, you would have to set an id attribute on div.wrapper_content, say wrapper_content, and change the respective line:

Code: Select all

anchors[i].href += "#wrapper_content";

It seems that this Script does not work here:
http://rancdubina.cmsimple.sk (themeswitcher included in navigation).
So I am loking for some compromise. The standard template has some advantages concerning the calendar functionality and also the register plugin. The disadvantage is that it doesn't jumpt to the page chosen in navigation. The scrolling is the only way.

Onepage template available. It jumps nicely to pages, but some plugins have problem to handle the page properly, jumping always to the 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: 11858
Joined: Tue Jun 21, 2011 11:04 am
Location: Mü-Sa, RLP, DE
Contact:

Re: Only an idea

Postby cmb » Sat Oct 28, 2017 11:07 am

Tata wrote:It seems that this Script does not work here:

The script could fixed, but it still wouldn't cater to Register and Calendar. Instead you could use the following (in template.htm, immediately before </body>):

Code: Select all

<script>
window.addEventListener("load", function () {
    window.scrollTo(0, document.getElementById("content").offsetTop);
});
</script>

Or perhaps preferably:

Code: Select all

<script>
window.addEventListener("load", function () {
    if (window.location.search !== "") {
        window.scrollTo(0, document.getElementById("content").offsetTop);
    }
});
</script>

Not sure if either of the scripts will work in all cases, and most certainly the effect could be distracting, but it might be worth a try.

Generally, I would reconsider the design. If there is a large header, which seems to be so unimportant that scrolling down to the content happens automatically – why is the header there on all pages in the first place? An alternative might be to show the full header only on the start page, but a condensed header (only a single combined small image) on all other pages.
Christoph M. Becker –Plugins for CMSimple_XH, but not for CMSimple 4+

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

Re: Only an idea

Postby Tata » Sat Oct 28, 2017 11:32 am

cmb wrote:An alternative might be to show the full header only on the start page, but a condensed header (only a single combined small image) on all other pages.

Excellent idea. But I assume to need to refactor the whole template. Maybe to make the navigation static and have the first page without any content, or move the whole welcome screen into the first page's content?
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: 11858
Joined: Tue Jun 21, 2011 11:04 am
Location: Mü-Sa, RLP, DE
Contact:

Re: Only an idea

Postby cmb » Sat Oct 28, 2017 12:16 pm

Tata wrote:But I assume to need to refactor the whole template. Maybe to make the navigation static and have the first page without any content, or move the whole welcome screen into the first page's content?

Well, if there is no other content on the start page, the latter seems to be a good idea.
Christoph M. Becker –Plugins for CMSimple_XH, but not for CMSimple 4+


Return to “Changing layout”

Who is online

Users browsing this forum: No registered users and 1 guest