teraz się zastanawiam jak połączyć np. openWYSIWYG ze stroną html... tak żeby tylko osoba która przejdzie do odpowiedniej podstrony (np
http://www.jakasstrona.pl/admin.html) mogła edytować dowolnie wybraną przez siebie podstronę (np.
http://www.jakasstrona.pl/oferta.html).
Oto fragment dokumentacji openWYSIWYG:
Cytat
Setup the openWYSIWYG editor
Include the javascript files like the following:
<script language="JavaScript" type="text/javascript" src="scripts/wysiwyg.js"></script>
<script language="JavaScript" type="text/javascript" src="scripts/wysiwyg-settings.js"></script> // optional
Note: You might need to change the src path (red), depending on where you put the files.
Now you have to attach the openWYSIWYG editor to all or to defined textareas of your page.
<script language="javascript1.2">
// attach the editor to all textareas of your page.
WYSIWYG.attach('all');
// attach the editor to the textarea with the identifier 'textarea1'.
WYSIWYG.attach('textarea1');
</script>
Now try it out!
If you don't see any images on the toolbar then you have to change the image path.
Have a look at the customize section.
If you need to display contents of textarea's with HTML output support, but without the editing possibilities, you can use a function called display.
<script language="javascript1.2">
// display iframes instead of textareas. It apply's to all textareas of your page.
WYSIWYG.display('all');
// display an iframe instead of the textarea with the identifier 'textarea1'
WYSIWYG.display('textarea1');
</script>
Czy ktoś ma pomysł jak skonstruować taki mini panel zarządzania treścią ?
znalazłem coś co sprawiło że jestem trochę bliżej jak dalej
Plik.htmlKod
<a>Witajcie</a>
Edytor.phpKod
<table cellpadding="0" cellspacing="0" width="342" height="228">
<!-- MSTableType="layout" -->
<tr>
<td height="228" valign="top">
<?
$plik = 'plik.html';
$uchwyt = fopen($plik, 'r');
$tresc = fread($uchwyt, filesize($plik));
fclose($uchwyt);
$uchwyt = fopen($plik, 'r');
echo fread($uchwyt, filesize($plik));
fclose($uchwyt);
?>
<?
if ( !$_POST['wyslij'] ) {?>
<FORM ACTION="edytor.php?wyslij" METHOD="POST">
<p align="center">
<TEXTAREA NAME=edycja rows="30" cols="78"> <? echo $tresc ?> </TEXTAREA><br>
<INPUT TYPE="submit" VALUE="Zapisz" name=wyslij>
</p>
</FORM>
<?
} else
{
$plik = 'plik.html';
$uchwyt = fopen($plik, 'w');
fwrite($uchwyt, $_POST['edycja']);
fclose($uchwyt);
}
echo"<br><br><a href=\"edytor.php\">Powrót do eydcji</a>";
?></td>
</tr>
</table>
</center>
Plik.html jest edytowany przez
Edytor.php SCREENA jak
plik.html będzie zawierał:
Kod
<!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" xml:lang="pl" lang="pl">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2" />
<meta name="Description" content="Tu wpisz opis zawartości strony" />
<meta name="Keywords" content="Tu wpisz wyrazy kluczowe rozdzielone przecinkami" />
<title>Tu wpisz tytuł strony</title>
</head>
<body>
Tu wpisuje się treść strony
</body>
</html>
To pokaże mi coś takiego
SCREENA ja nie chce edytować całego kodu tylko
"Tu wpisuje się treść strony" jak to zrobić ?
Bo potem to już dodam jakiś WYSIWYG edytor i powinno działać