Page 1 of 2

How can a website template file .htm

Posted: Wed Sep 07, 2011 6:03 pm
by Termin
Good time of the day.

Please tell me how to add the website template file .htm

Re: How can a website template file .htm

Posted: Wed Sep 07, 2011 7:41 pm
by cmb
Hi Victor,
Termin wrote:Good time of the day
I guess that's the name of the template. Where did you get it?

Or did I totally misunderstand you?

Christoph

Re: How can a website template file .htm

Posted: Thu Sep 08, 2011 11:41 am
by Termin
Hi Christoph
No, wrong.
The template is connected file content.htm I need to connect to the template of another file myfile.htm

Trying to simulate the connection script

Code: Select all

<a href="../../php5/PHPDOCX.htm" onClick="NewWindow(this.href,'name','600','600','yes');return false"><p>ЧИТАТЬ</p></a>
<script language="javascript">
var win = null;
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
win = window.open(mypage,myname,settings)
}</script>
but the result of a new window outside of the template.

http://pixelcom.crimea.ua/php5/PHPDOCX.htm

Re: How can a website template file .htm

Posted: Thu Sep 08, 2011 12:07 pm
by cmb
Hello Victor,
Termin wrote:The template is connected file content.htm I need to connect to the template of another file myfile.htm
The template is intrinsically linked to content.htm by the whole structure of CMSimple, and the structure of content.htm has to be special. So it is not possible to just use an arbitrary html file as replacement for content.htm. So you have basically to options:

1. Include the body of myfile.htm directly to content.htm with the CMSimple editor. That would be the simplest solution.

2. Another possibility is to include myfile.htm into an IFrame. This could be easily done with the Wrapper plugin.

Christoph

Re: How can a website template file .htm

Posted: Fri Sep 09, 2011 7:42 am
by Termin
Hello Christoph,
cmb wrote:So it is not possible to just use an arbitrary html file as replacement for content.htm.
This can not be! :ugeek:
cmb wrote:Include the body of myfile.htm directly to content.htm with the CMSimple editor.
content.htm crowded! :shock:
cmb wrote:This could be easily done with the Wrapper plugin.
Plug-ins are very poorly made my opinion.

Re: How can a website template file .htm

Posted: Fri Sep 09, 2011 10:05 am
by cmb
Hello Victor,

just to explain: you can't replace myfile.htm as content.htm, because CMSimple parses content.htm and splits at <h1>, <h2>, <h3> (can be configured by menu_level) into the separate pages. The <head> is completely discarded. So it's not possible to use an arbitrary HTML file as content.htm.
Termin wrote:content.htm crowded!
Ah, I see!So there is a third possibility: you can use the multilanguage feature of CMSimple, as it is quite versatile. Just make of copy of the 2lang/ folder and rename it to have exactly 2 letters (e.g. my/) Then browse to http://www.example.com/my/ and edit it's content. And link to it from your website. You can have as many of those "language" directories as you wish. This language specific content shares all the settings with the base installation (config.php, template.htm etc.) except the language settings; so you can copy cmsimple/languages/ru.php to cmsimple/languages/my.php and cmsimple/languages/ruconfig.php to cmsimple/languages/myconfig.php.
Termin wrote:Plug-ins are very poorly made my opinion.
Are you referring to the plugin system or to individual plugins?

Christoph

Re: How can a website template file .htm

Posted: Fri Sep 09, 2011 10:49 am
by Termin
Hello Christoph,
I understood You. And so I did.
cmb wrote:Are you referring to the plugin system or to individual plugins?
All except the system.

Victor

Re: How can a website template file .htm

Posted: Fri Sep 09, 2011 11:38 am
by cmb
Hello Victor,

I've just seen, that you're already using the multi-language feature of CMSimple for real languages. So if you're going to use it the way I've described above, you have to sort the pseudo-languages out in languagemenu().
Termin wrote:Plug-ins are very poorly made my opinion.
cmb wrote:Are you referring to the plugin system or to individual plugins?
Termin wrote:All except the system.
IMO there is room for improvement, at least for many plugins. But I won't say: "all of them are poorly made". I would be glad, if you will explain, what is poorly made about them (perhaps in a new thread in the "Open Development" section):
- are the plugins too slow?
- are they buggy or faulty?
- do they produce bad HTML output?
- are they poorly documented?
- do you miss flexibility or more features?

Perhaps the problem is, that the plugin developers are lacking feedback in form of constructive criticism, and so are not aware of deficiencies.

Christoph

Re: How can a website template file .htm

Posted: Fri Sep 09, 2011 7:58 pm
by Termin
Hello Christoph,
cmb wrote:So if you're going to use it the way I've described above, you have to sort the pseudo-languages out in languagemenu().
And that's not understand what to do with flags?
-------------------------------
At the first opportunity I will write an article about plug-ins CMSimple with the details of the deficiencies, but it will be described in Russian language!

Re: How can a website template file .htm

Posted: Fri Sep 09, 2011 8:19 pm
by cmb
Hello Victor,

if you use a folder called my/ then CMSimple thinks, that it's a real language, so it will display it in the language menu. But as no flag exists in images/flags/my.gif, it will display it as [my]. So it might be best to rewrite function languagemenu():

Code: Select all

function languagemenu() {
    ... // same as it was
    while (($p = @readdir($fd)) == true ) {
        if (@is_dir($pth['folder']['base'].$p)) {
            if (preg_match('/^[A-z]{2}$/', $p)
                     && !in_array($p, array('my', 'pseudo', 'languages')) // replace the strings with the names of your "special" language folders
                $r[] = $p;
        }
    }
    ... // same as it was
 
Then you have to insert links to the new "special" language folders somewhere on your site manually.
Termin wrote:but it will be described in Russian language!
I'm afraid that only a minority of plugin developers understand Russian. But anyway, I'll be glad if you'll post a link to your article, when you've written it. Perhaps somebody will translate it.

Christoph