Создать шаблон в MODx.
Вы можете сделать свой, самодельный шаблон, но он не будет динамическим, а простым одностраничником.
Используя консультации Ефимова Виктора - http://efimov.ws/main/develop/modx/tags-MODx.html и на сайте - http://community.modx-cms.ru/blog/documentation/1253.html я придумал свой шаблон.
[*pagetitle*] — эта конструкция выводит содержимое поля «Заголовок», которое мы будем заполнять на странице создания/редактирования ресурса.
[*longtitle*] — выводит содержимое поля «Расширенный заголовок». Обычно используется как главный заголовок <h1> на странице.
[*description*] — выводит содержимое поля «Описание». Это поле будем использовать для вывода содержимого в META-теге description.
[*introtext*] — выводит содержимое поля «Аннотация». Это поле чаще всего используют при создании новостей, заметок в блоге и т.п. для организации страниц с кратким описанием заметок.
[*content*] — основное содержимое страниц. Конструкция выводит любой текст или HTML код, написанный или отредактированный в визуальном редакторе.
[*id*] — выводит идентификатор ресурса.
[*alias*] — выводит псевдоним ресурса.
[~идентификатор~] — выводит URL адрес ресурса, идентификатор которого указан. Например, если ID страницы «Новости» — 4, а псевдоним этой страницы — «news», то конструкция [~4~] выведет URL вашей страницы с новостями.
Если вы умеете управлять этими тегами, то вы спокойно можете создавать любые шаблоны для MODx.
[*pub_date*] — дата публикации ресурса
[*unpub_date*] — дата завершения публикации
[*createdby*] — идентификатор пользователя, создавшего ресурс
[*createdon*] — дата создания ресурса
[*editedby*] — идентификатор пользователя, редактировавшего ресурс
[*editedon*] — дата редактирования ресурса
[*contentType*] — тип содержимого (например, text/html)
[*type*] — тип (ресурс, папка или ссылка)
[*published*] — опубликован ли ресурс (1|0)
[*parent*] — номер (ID) родительского ресурса
[*isfolder*] — является ли ресурс папкой (1|0)
[*richtext*] — используется ли при редактировании страницы визуальный редактор
[*template*] — номер (ID) используемого шаблона для ресурса
[*menuindex*] — порядковый номер отображения в меню
[*searchable*] — доступен ли ресурс для поиска (1|0)
[*cacheable*] — кэшируется ли ресурс (1|0)
[*deleted*] — ресурс удален (1|0)
[*deletedby*] — идентификатор пользователя, удалившего ресурс
[*menutitle*] — заголовок меню, если таковой есть
[*donthit*] — слежение за количеством посещений отключено (1|0)
[*haskeywords*] — ресурс содержит ключевые слова (1|0)
[*hasmetatags*] — ресурс имеет META теги (1|0)
[*privateweb*] — ресурс входит в частную группу пользовательских документов (1|0)
[*privatemgr*] — ресурс входит в частную группу менеджерских документов (1|0)
[*content_dispo*] — вариант выдачи содержимого (1 — для отображения | 0 — прикрепленное для скачивания)
[*hidemenu*] — документ не отображается в меню (1|0)
[(modx_charset)] — выводит название используемой кодировки
[^qt^] — выводит время запросов к базе данных
[^q^] — выводит количество запросов к базе данных
[^p^] — выводит время работы PHP скриптов
[^t^] — выводит общее время генерации страницы
[^s^] — выводит источник содержимого (база или кэш)
Устаревшие теги:
<center> Устаревший. Определяет центрированное содержимое
<font> Устаревший. Определяет HTML шрифты
<s> и <strike>Устаревший. Определяет зачеркнутый текст
<u> Устаревший. Определяет подчеркнутый текст
Атрибуты Описание
align Устаревший. Определяет выравнивание текста
bgcolor Устаревший. Определяет цвет фона
color Устаревший. Определяет цвет текста
1. Форма ввода: <input type="text" title="название формы" maxlength="максимальное число вводимых знаков" value="" />
2. Картинка на сайте: <img src="http://url_картинки" alt="название картинки" width="ширина в пикселях(необязательно)" height="высота в пикселях(необязательно)"/></a></br>
3. Форма ввода пароля: <input type="password" title="название формы" maxlength="максимальное число вводимых знаков" value="" />
4. Отправка e-mail с сайта: <input name="mail" format="text" value="текст сообщения e-mail"/><a href="mailto:адрес@получателя.ru">Написать</a><br/>
5. Звонок с сайта: Введите номер:<input name="num" format="*N"/><a href="wtai://wp/mc;$(num)">Вызов</a><br/>Имя:<input name="name"/><a href="wtai://wp/ap;$(num);$(name)">Сохранить</a><br/>
6. Отправка СМС с сайта: Введите номер<input name="n" format="*N"/><br/>Введите сообщение:<input name="b"/><br/><a href="smsto:$(n)?body=$(b)">Отправить</a><br/>
7. Время и дата(русск. вер.): (хорошо работает)
<body onLoad="goforit()">
<script>
/*
Live Date Script-
© Dynamic Drive (www.dynamicdrive.com)
For full source code, installation instructions, 100's more DHTML scripts, and Terms Of Use,
visit http://www.dynamicdrive.com
*/
var dayarray=new Array("Воскресенье","Понедельник","Вторник","Среда","Четверг","Пятница","Суббота")
var montharray=new Array("Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь")
function getthedate(){
var mydate=new Date()
var year=mydate.getYear()
if (year < 1000)
year+=1900
var day=mydate.getDay()
var month=mydate.getMonth()
var daym=mydate.getDate()
if (daym<10)
daym="0"+daym
var hours=mydate.getHours()
var minutes=mydate.getMinutes()
var seconds=mydate.getSeconds()
var dn="AM"
if (hours>=12)
dn="PM"
if (hours>12){
hours=hours-12
}
if (hours==0)
hours=12
if (minutes<=9)
minutes="0"+minutes
if (seconds<=9)
seconds="0"+seconds
//change font size here
var cdate="<small><font color='000000' face='Arial'><b>"+dayarray[day]+", "+montharray[month]+" "+daym+", "+year+" "+hours+":"+minutes+":"+seconds+" "+dn
+"</b></font></small>"
if (document.all)
document.all.clock.innerHTML=cdate
else if (document.getElementById)
document.getElementById("clock").innerHTML=cdate
else
document.write(cdate)
}
if (!document.all&&!document.getElementById)
getthedate()
function goforit(){
if (document.all||document.getElementById)
setInterval("getthedate()",1000)
}
</script>
<span id="clock"></span>
8. Счётчик времени нахождения на странице: <FORM name="d"> <P><INPUT type="text" size="8" name="d2"></P></FORM>
<script>
<!--
/*By George Chiang. (WA's ultimate JavaScript tutorial and free JavaScripts site!)
http://www.wsabstract.com
Credit MUST stay intact for use*/
var milisec=0
var seconds=0
document.d.d2.value='0'
function display(){
if (milisec>=9){
milisec=0
seconds+=1
}
else
milisec+=1
document.d.d2.value=seconds+"."+milisec
setTimeout("display()",100)
}
display()
//-->
</script>
9. Видео на сайте: <script language="javascript" type="text/javascript">
//Скрипт для вставки AVI-файла
if (navigator.appName.indexOf("Microsoft")>=0) {
hTag='<img border="1" dynsrc="http://url_видео.avi" start="fileopen" loop="infinite" width="200" height="200">'
}else{
hTag='<embed src="http://url_видео.avi" autostart=true loop=true controller=false width="200" height="200">'
}
document.write (hTag)
</script>
10. Скрипт калькулятора: (действующий)
<DIV align="center"><TABLE border="2" width="100" cellspacing="0" cellpadding="0" bgcolor="#000000" style="border-color:black" onClick="previouskey=event.srcElement.innerText"><TR><TD width="100%" bgColor="#b3b494" id="result" style="font:bold 10px Verdana;color:black;text-align='right'">0</TD></TR><TR><TD width="100%" valign="middle" align="center"><TABLE border="0" width="100%" cellspacing="0" cellpadding="0" style="font:bold 10px Verdana;color:white" bgColor="#b3b494"><TR><TD bgColor="#b3b494" width="80%" align="center"><TABLE border="1" width="100%" cellspacing="0" cellpadding="0" style="cursor:hand;font:bold 10px Verdana;color:white" onMouseover="if (event.srcElement.tagName=='TD')event.srcElement.style.color='red'" onMouseout="event.srcElement.style.color='white'" onselectStart="return false" onClick="calculate()" height="82"><TR><TD width="25%" align="center" height="17">7</TD><TD width="25%" align="center" height="17">8</TD><TD width="25%" align="center" height="17">9</TD><TD width="25%" align="center" height="17">/</TD></TR><TR><TD width="25%" align="center" height="19">4</TD><TD width="25%" align="center" height="19">5</TD><TD width="25%" align="center" height="19">6</TD><TD width="25%" align="center" height="19">*</TD></TR><TR><TD width="25%" align="center" height="19">1</TD><TD width="25%" align="center" height="19">2</TD><TD width="25%" align="center" height="19">3</TD><TD width="25%" align="center" height="19">-</TD></TR><TR><TD width="25%" align="center" height="19">0</TD><TD width="25%" align="center" height="19" onClick="pn();previouskey=1;event.cancelBubble=true">+/-</TD><TD width="25%" align="center" height="19">.</TD><TD width="25%" align="center" height="19">+</TD></TR></TABLE></TD><TD width="20%"><DIV align="left"><TABLE border="1" width="100%" cellspacing="0" cellpadding="0"><TR><TD width="100%" style="cursor:hand;font:bold 10px Verdana;color:white;text-align:center" onClick="result.innerText=0;results=''">C</TD></TR></TABLE></DIV><DIV align="left"><TABLE border="1" width="100%" cellspacing="0" cellpadding="0" height="81"><TR><TD width="100%" style="cursor:hand;font:bold 12px Verdana;color:white;text-align:center" onMouseover="event.srcElement.style.color='yellow'" onMouseout="event.srcElement.style.color='white'" onClick="calculateresult()">=</TD></TR></TABLE></DIV></TD></TR></TABLE></TD></TR></TABLE>
<script language="JavaScript1.2">
/*
DHTML Calculator Script-
© Dynamic Drive (www.dynamicdrive.com)
For full source code, installation instructions,
100's more DHTML scripts, and Terms Of
Use, visit dynamicdrive.com
*/
var results=''
var previouskey=''
var re=/(\/|\*|\+|-)/
var re2=/(\/|\*|\+|-){2}$/
var re3=/.+(\/|\*|\+|-).+/
var re4=/\d|\./
var re5=/^[^\/\*\+].+\d$/
var re6=/\./
function calculate(){
if (event.srcElement.tagName=="TD"){
if (event.srcElement.innerText.match(re4)&&previouskey=="=")
results=''
if (result.innerText.match(re3)&&event.srcElement.innerText.match(re)){
if (!results.match(re5)){
result.innerText="Error!"
return
}
results=eval(results)
if (results.toString().length>=12&&results.toString().match(re6))
results=results.toString().substring(0,12)
result.innerText=results
}
results+=event.srcElement.innerText
if (results.match(re2))
results=results.substring(0,results.length-2)+results.charAt(results.length-1)
result.innerText=results
}
}
function calculateresult(){
if (!results.match(re5)){
result.innerText="Error!"
return
}
results=eval(results)
if (results.toString().length>=12&&results.toString().match(re6))
results=results.toString().substring(0,12)
result.innerText=results
}
function pn(){
if (result.innerText.charAt(0)!='-')
result.innerText=results='-'+result.innerText
else if (result.innerText.charAt(0)=='-')
result.innerText=results=result.innerText*(-1)
}
</script>
11. Часы в углу страницы:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<meta http-equiv="content-script-type" content="text/javascript">
<meta http-equiv="content-style-type" content="text/css">
<style type="text/css">
<!--
body{
background-color : #000000;
}
//-->
</style>
</head>
<body>
<script>
//Standard Analogue Clock - http://www.btinternet.com/~kurt.grigg/javascript
if ((document.getElementById) &&
window.addEventListener || window.attachEvent){
(function(){
var fCol="#00ff00"; //face colour.
var dCol="#ffffff"; //dots colour.
var hCol="#ff0000"; //hours colour.
var mCol="#ffffff"; //minutes colour.
var sCol="#00ff00"; //seconds colour.
//Alter nothing below! Alignments will be lost!
var dial = "3 4 5 6 7 8 9 10 11 12 1 2";
dial = dial.split(" ");
var e = 360/dial.length;
var h = 3;
var m = 4;
var s = 5;
var y = 50;
var x = 50;
var cyx = 30/4;
var theDial = [];
var theDots = [];
var theHours = [];
var theMinutes = [];
var theSeconds = [];
var idx = document.getElementsByTagName('div').length;
var pix = "px";
document.write('<div style="position:relative;width:'+(x*2)+'px;height:'+(y*2)+'px">');
for (i=0; i < dial.length; i++){
document.write('<div id="F'+(idx+i)+'" style="position:absolute;top:0px;left:0px;width:15px;height:15px;'
+'font-family:arial,sans-serif;font-size:10px;color:'+fCol+';text-align:center">'+dial[i]+'<\/div>');
document.write('<div id="D'+(idx+i)+'" style="position:absolute;top:0px;left:0px;'
+'width:2px;height:2px;font-size:2px;background-color:'+dCol+'"><\/div>');
}
for (i=0; i < h; i++){
document.write('<div id="H'+(idx+i)+'" style="position:absolute;top:0px;left:0px;'
+'width:2px;height:2px;font-size:2px;background-color:'+hCol+'"><\/div>');
}
for (i=0; i < m; i++){
document.write('<div id="M'+(idx+i)+'" style="position:absolute;top:0px;left:0px;'
+'width:2px;height:2px;font-size:2px;background-color:'+mCol+'"><\/div>');
}
for (i=0; i < s; i++){
document.write('<div id="S'+(idx+i)+'" style="position:absolute;top:0px;left:0px;'
+'width:2px;height:2px;font-size:2px;background-color:'+sCol+'"><\/div>');
}
document.write('<\/div>');
function clock(){
var time = new Date();
var secs = time.getSeconds();
var secOffSet = secs - 15;
if (secs < 15){
secOffSet = secs+45;
}
var sec = Math.PI * (secOffSet/30);
var mins = time.getMinutes();
var minOffSet = mins - 15;
if (mins < 15){
minOffSet = mins+45;
}
var min = Math.PI * (minOffSet/30);
var hrs = time.getHours();
if (hrs > 12){
hrs -= 12;
}
var hrOffSet = hrs - 3;
if (hrs < 3){
hrOffSet = hrs+9;
}
var hr = Math.PI * (hrOffSet/6) + Math.PI * time.getMinutes()/360;
for (i=0; i < s; i++){
theSeconds[i].top = y + (i*cyx) * Math.sin(sec) + pix;
theSeconds[i].left = x + (i*cyx) * Math.cos(sec) + pix;
}
for (i=0; i < m; i++){
theMinutes[i].top = y + (i*cyx) * Math.sin(min) + pix;
theMinutes[i].left = x + (i*cyx) * Math.cos(min) + pix;
}
for (i=0; i < h; i++){
theHours[i].top = y + (i*cyx) * Math.sin(hr) + pix;
theHours[i].left = x + (i*cyx) * Math.cos(hr) + pix;
}
setTimeout(clock,100);
}
function init(){
for (i=0; i < dial.length; i++){
theDial[i] = document.getElementById("F"+(idx+i)).style;
theDial[i].top = y-6 + 30 * 1.4 * Math.sin(i*e*Math.PI/180) + pix;
theDial[i].left = x-6 + 30 * 1.4 * Math.cos(i*e*Math.PI/180) + pix;
theDots[i] = document.getElementById("D"+(idx+i)).style;
theDots[i].top = y + 30 * Math.sin(e*i*Math.PI/180) + pix;
theDots[i].left= x + 30 * Math.cos(e*i*Math.PI/180) + pix;
}
for (i=0; i < h; i++){
theHours[i] = document.getElementById("H"+(idx+i)).style;
}
for (i=0; i < m; i++){
theMinutes[i] = document.getElementById("M"+(idx+i)).style;
}
for (i=0; i < s; i++){
theSeconds[i] = document.getElementById("S"+(idx+i)).style;
}
clock();
}
if (window.addEventListener){
window.addEventListener("load",init,false);
}
else if (window.attachEvent){
window.attachEvent("onload",init);
}
})();
}//End.
</script>
</body>
</html>
12. Воспроизведения музыки из устройства: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML> <HEAD>
<TITLE>Звук с выбором из компьютера</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1251">
<META content="MSHTML 6.00.2900.2180" name=GENERATOR></HEAD>
<BODY text=#fbff46 bgColor=#000000><BGSOUND id=sound1><BGSOUND id=sound2>
<SCRIPT>
function play(){
sound1.src=source.value
sound2.src=source.value
}
function stop(){ sound1.src=""
sound2.src=""
}
</SCRIPT>
<CENTER><BR><INPUT id=source
style="BACKGROUND: #ffcc33; WIDTH: 600px; text: ffffff" type=file><BR><INPUT style="BACKGROUND: #00ff00" onclick=play() type=button value=play><INPUT style="BACKGROUND: #ff3333" onclick=stop();stoptimer(); type=button value=stop>
</CENTER></BODY> </HTML>
13. Мелодия на странице: ( этот скрипт нужно дорабатывать)
<body bgsound src="http://url_мелодии(midi, mp3)" loop="число повторений" volume="громкость(-1000 - 0)" balance="баланс(-1000 - 1000)" />
14. Переадресация: <meta http-equiv="refresh" content="время в сек.;url=http://url_страницы">
15. Сделать страницу стартовой: <A onclick="this.style.behavior='url(#default#homepage)';this.setHomePage('http://ваш_сайт.ru'); return false;" href=http://www.ваш_сайт.ru/index.html#>Сделать стартовой</A>
16. Добавить страницу в избранное: <script Language="Javascript">
var bm_url="http://url_страницы"
var bm_titel="Описание"
function bookmark()
{if (document.all)
window.external.AddFavorite(bm_url,bm_titel)}
</script>
</SCRIPT>
</head>
<body OnLoad="bookmark()">
17. Поиск на странице: <html>
<head>
<title>Поиск на странице через внешнюю форму с выделением фоном найденных слов</title>
<meta http-equiv="Содержимое-Тип" content="text/html; charset=windows-1251">
</head>
<body bgcolor="#003366" text="#000000">
<p><a href="javascript:FD983r={x:function(){var r,i,s=document.selection.createRange().text;if(!s)s=prompt('Найти:','');if(s){r=document.body.createTextRange();for(i=0;r.findText(s);i++){r.execCommand('BackColor','','FFFF66');r.collapse(false)};alert('Найдено: '+i+' слово(а)')}}};FD983r.x()">Найти
на странице</a> </p>
18. Печать страницы: <form>
<input type=button value="Напечатать страницу" onClick="myprint()" name="button">
</form>
19. Иконка сайта: (между тегами <head>)<link rel="icon" href="http://url_иконки.ico" type="image/x-icon">
<link rel="shortcut icon" href="http://url_иконки.ico" type="image/x-icon">(и </head>)
20. Счётчик нахождения на странице: <SCRIPT LANGUAGE="JavaScript">
<!--
// Copyright (c) 1996-1997 Tomer Shiran. All rights reserved.
// Permission given to use the script provided that this notice remains as is.
// Additional scripts can be found at http://www.webmastersonline.hpage.net
// Boolean variable specified if alert should be displayed if cookie exceeds 4KB
var caution = false
// name - name of the cookie
// value - value of the cookie
// [expires] - expiration date of the cookie (defaults to end of current session)
// [path] - path for which the cookie is valid (defaults to path of calling document)
// [domain] - domain for which the cookie is valid (defaults to domain of calling document)
// [secure] - Boolean value indicating if the cookie transmission requires a secure transmission
// * an argument defaults when it is assigned null as a placeholder
// * a null placeholder is not required for trailing omitted arguments
function setCookie(name, value, expires, path, domain, secure) {
var curCookie = name + "=" + escape(value) +
((expires) ? "; expires=" + expires.toGMTString() : "") +
((path) ? "; path=" + path : "") +
((domain) ? "; domain=" + domain : "") +
((secure) ? "; secure" : "")
if (!caution || (name + "=" + escape(value)).length <= 4000)
document.cookie = curCookie
else
if (confirm("Cookie exceeds 4KB and will be cut!"))
document.cookie = curCookie
}
// name - name of the desired cookie
// * return string containing value of specified cookie or null if cookie does not exist
function getCookie(name) {
var prefix = name + "="
var cookieStartIndex = document.cookie.indexOf(prefix)
if (cookieStartIndex == -1)
return null
var cookieEndIndex = document.cookie.indexOf(";", cookieStartIndex + prefix.length)
if (cookieEndIndex == -1)
cookieEndIndex = document.cookie.length
return unescape(document.cookie.substring(cookieStartIndex + prefix.length, cookieEndIndex))
}
// name - name of the cookie
// [path] - path of the cookie (must be same as path used to create cookie)
// [domain] - domain of the cookie (must be same as domain used to create cookie)
// * path and domain default if assigned null or omitted if no explicit argument proceeds
function deleteCookie(name, path, domain) {
if (getCookie(name)) {
document.cookie = name + "=" +
((path) ? "; path=" + path : "") +
((domain) ? "; domain=" + domain : "") +
"; expires=Thu, 01-Jan-70 00:00:01 GMT"
}
}
// date - any instance of the Date object
// * you should hand all instances of the Date object to this function for "repairs"
// * this function is taken from Chapter 14, "Time and Date in JavaScript", in "Learn Advanced JavaScript Programming"
function fixDate(date) {
var base = new Date(0)
var skew = base.getTime()
if (skew > 0)
date.setTime(date.getTime() - skew)
}
var now = new Date()
fixDate(now)
now.setTime(now.getTime() + 365 * 24 * 60 * 60 * 1000)
var visits = getCookie("counter")
if (!visits)
visits = 1
else
visits = parseInt(visits) + 1
setCookie("counter", visits, now)
document.write("Вы находились на этой странице " + visits + " раз.")
// -->
</SCRIPT>
21. Авторизация пользователя на сайте: <HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=Windows-1251">
<SCRIPT LANGUAGE="JavaScript">
function login()
{
var login, pass, glogin='логин', gpass='пароль';
login = mainform.elogin.value;
pass = mainform.epass.value;
if (login == glogin & gpass == pass)
window.location.href="http://url_страницы, куда будет перенаправлен пользователь.html";
}
</SCRIPT>
</HEAD>
<BODY>
<FORM NAME="mainform">
<center>
<div style="font:bold 12pt Georgia"> Добро Пожаловать! <br /><br /> </div>
Логин:
<INPUT TYPE="text" NAME="elogin" SIZE=15 >
Пароль:
<INPUT TYPE="password" NAME="epass" SIZE=15 >
<BR /> <BR />
<INPUT TYPE="button" VALUE="Вход" ONCLICK="login()">
</center>
</FORM>
</BODY>
22. Всплывающее приветствие: (Действующее всплывающее окошко) в нем можно написать что угодно.
<body onload="alert('Добро пожаловать!!!')">
23. Проверка статуса ICQ: <SCRIPT LANGAUGE="JAVASCRIPT 1.3 TYPE="text/javascript">
<!-- Begin
function icqCheck() {
var number = document.ICQ.number.value;
text = "<html><body><center><br>"
+ number + " сейчас: <img src=http://online.mirabilis.com/"
+ "scripts/online.dll?icq=" + number + "&img=5> "
+ "</body></html>";
windowprops = "toolbar=no,width=150,height=25,"
+ "directories=no,status=no,scrollbars=no,resize=no,"
+ "menubar=no";
icqWindow=window.open("","displayWindow",windowprops)
icqWindow.document.write(text);
icqWindow.document.close();
icqWindow.focus();
}
// End -->
</script>
<center><FORM name="ICQ"> <DIV center><P>ICQ: <INPUT type="text" name="number" size="10" value=""><BR> <INPUT type="button" name="check" value="Проверка" onClick="icqCheck()"> </P></DIV> </FORM><P align="center"> </P><P align="center"> </P><P align="center"> </P><P align="center"></center>
24 Скрипт вывода времени в заголовке страницы: (Вместо заголовка страницы показывает время)
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<title>Загрузка...</title>
</head>
<body bgcolor="#FFFFFF" text="#000000" onload="start(document.forms[0])"
onunload="cleartids()">
<script language="JavaScript">
timestr = "00:00:00";
tid = 0;
pause = 0;
var to;
var bcount;
var tcount;
function writer(){
document.write("test");
}
function time(n) {
tid=window.setTimeout("time(1)",to);
today = new Date()
if(today.getMinutes() < 10){
pad = "0"}
else
pad = "";
if(today.getSeconds() < 10){
pads = "0"}
else
pads = "";
timestr=today.getHours()+":"+pad+today.getMinutes()+":"+pads+today.getSeconds();
document.title = timestr;
window.clearTimeout(tid);
tid=window.setTimeout("time()",to);
}
function start(x) {
f=x;
to=60;
time(x);
}
function cleartids() {
window.clearTimeout(tid);
}
</script>
<p>Смотрите на заголовок страницы...</p>
</body>
</html>
25 Ввод пароля при входе на страницу: (действующий, простой)
<script language="JavaScript">
if (top.location.search=="") {
pass = prompt('ваш пороль');
if (pass=='448135') // Ваш пароль акивации
{ alert('Пароль принят') } else { alert('Пароль непринят!'), top.location.href="http://network.klandaic.com/" }//Адрес страниц на которую перейдет пользователь при ошибке
};
</script>
-----------------------------------------------------------------------------------------------------------------------------------------------------------------
Чанки :
Отделил верхнюю часть в чанк - шапка
<body>
<table
style="text-align: left; margin-left: auto; margin-right: auto; width: 912px; height: 66px; background-color: rgb(51, 204, 255);"
border="1" cellpadding="2" cellspacing="2">
<tbody>
<tr>
<td>
<h1>{{персональныйБ}} <span style="color: rgb(255, 28, 6);">[*pagetitle*]</span>
</h1>
</td>
</tr>
</tbody>
</table>
<br>
</body>
Нижняя часть в чанк - низ
<div style="text-align: center;">
<table
style="text-align: left; margin-left: auto; margin-right: auto; background-color: rgb(51, 204, 255); width: 912px; height: 42px;"
border="1" cellpadding="2" cellspacing="2">
<tbody>
<tr>
<td>
<div class="base">
<div class="base pagelink">
<div
style="text-align: center; background-color: rgb(255, 204, 204);"><a
name="00"></a><a
style="color: rgb(0, 0, 0); font-weight: bold;"
права защищены. </a> <a
style="color: rgb(0, 122, 0);"
style="font-weight: bold;">Реклама.</span></a> |<COMMENT
title=" "' "
style="line-height: 115%; font-family: 'Calibri','sans-serif'; color: rgb(51, 51, 255); font-size: 14pt;">Переводчик.</span></i></b><b><i><span
style="line-height: 115%; font-family: 'Calibri','sans-serif'; color: rgb(51, 51, 255); font-size: 14pt;"></span></i></b></a><span
class="pbfeg_sX"></span><span
style="text-decoration: underline;"></span><span
class="pbfeg_sX"></span><span class="pbfeg_sX"> <a
style="line-height: 115%; font-family: 'Calibri','sans-serif'; color: red; font-size: 12pt;">Помощь
</span></i></b></a><b><i><span
style="line-height: 115%; font-family: 'Calibri','sans-serif'; color: red; font-size: 12pt;">
</span></i></b><a
style="color: rgb(0, 153, 0);"
class="operator"><b><span
style="line-height: 115%; font-family: 'Tahoma','sans-serif'; font-size: 11.5pt;">Обратная
связь</span></b></span></a>
{{сайтблок}}<b><i><span
style="color: rgb(102, 255, 153);"> </span></a></span></i></b></div>
</div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
А средина редактируется в визуальном редакторе.
Можно посмотреть Альбом. Посмотреть Другие новости.
Mой шаблон в MODx:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>[(site_name)] » [*pagetitle*]</title>
<meta http-equiv="content-type" content="text/html; charset=[(modx_charset)]" />
<meta name="keywords" content="" />
<base href="[(site_url)]"></base>
<link rel="stylesheet" type="text/css" href="assets/templates/MyTemplate/site.css" />
<link rel="shortcut icon" href="./assets/images/favicon.ico" />
<!--[if lt IE 7]>
<style type="text/css">
body { behavior: url(assets/js/csshover3.htc) }
img { behavior: url(assets/js/frankensleight.htc) }
</style>
<![endif]-->
</head>{{шапка}}
<body>
<div id="masthead">
<h1></h1>
<h2>[*longtitle*]</h2>
<div class="clearing"></div>
<!-- end masthead --></div>
<div id="wrapper">
<div id="main">
[*content*]
<!-- end main --></div>
<div id="side1">
[*LeftSide*]
<!-- end side1 --></div>
<div id="side2">
[*RightSide*]
<!-- end side2 --></div>
<div class="clearing"></div>
<!-- end wrapper --></div>
<div id="footer">
{{низ}}
<!-- end footer --></div>
</body>
</html>