Changing the default dreamweaver templates - php

I'm not sure if this is programming-related enough for stack overflow, but anyways...
I want to change the code that is created in dreamweaver when you create a new HTML file or PHP file.
For example, I want to replace the default doctype and HTML tag:
<!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">
with this:
<!DOCTYPE html>
<html>
How can I do this?

On Mac OS X, you'll find Dreamweaver's Document Type Declaration configurations at:
/Applications/Adobe Dreamweaver/Configuration/DocumentTypes
To add a new template for HTML5 documents, open the file MMDocumentTypeDeclarations.xml and add a new element:
<documenttypedeclaration id="mm_html_5">
<title>
<MMString:loadString id="mmdocumenttypedeclarations/mm_html_5" />
</title>
<doctypedecl>
<![CDATA[<!DOCTYPE HTML>]]>
</doctypedecl>
<rootelement>
<![CDATA[<html></html>]]>
</rootelement>
<dtdcontext>html</dtdcontext>
<dtdcontext>html5</dtdcontext>
<dtdcontext>frameset_frame</dtdcontext>
<dtdcontext>xslt</dtdcontext>
</documenttypedeclaration>
When creating new documents, Dreamweaver references MMDocumentTypeDeclarations.xml and matches the <dtdcontext> against the Page Type you selected in the New Document dialog box.
By modifying this XML file, you don't have to edit any of the templates in:
/Applications/Adobe Dreamweaver/Configuration/DocumentTypes/NewDocuments
If you're running Dreamweaver CS5+ (version 11), Adobe already includes updated DTDs for HTML5:
Which creates the following blank document:
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<title>Untitled Document</title>
</head>
<body>
</body>
</html>
You can change which DOCTYPE is used by default when creating new documents by going into Dreamweaver's preferences:

In Windows, the file is at
C:\Program Files\Adobe\Adobe Dreamweaver CS3\configuration\DocumentTypes\NewDocuments\Default.html
Replace "CS3" with your Adobe CS version.

Still works in 2019 (using the subscription) in Win10:
C:\Program Files\Adobe\Adobe Dreamweaver CC 2019\configuration\DocumentTypes\NewDocuments

Related

My CKEditor and input field do not support Unicode

I am using CKEditor, i want to use Unicode and insert in database.
I copy the language and paste in CKEditor or input text and try to insert in database phpmyadmin. But I cannot get the desired output.
How to make my php website Unicode supportive. I am using HTML4 and i need to change my heading.
Here is my HTML
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta charset="ISO-8859-1">
I m using phpmyadmin, and i change collations and set it to utf8_general_ci.
And That solve my problem.

In Google cloud, Language texts not displayed in proper way

I have a piece of code in html and php for my index.php. This page is used for users to register. The users inserts its details and the registration process works successfully. The user can insert its details written in every language, and all characters are recognized and displayed in the right format. That works fine in localhost in my laptop using xampp. When I uploading my code to google cloud, however a problem occurs. If the user register himself with text lets say in Russian language, then in my database text stored in a strange format like & upsilon ; etc Probably the problem here is that when I upload my code to google cloud, not all language formats are read in the proper way. Any ideas on how to fix this?
This is my code:
<?php
include 'init.php';
?>
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="css/main.css" type="text/css">
<title> My page </title>
</head>
<body>
----------here is the form where the user register
</body>
</html>
my problem is that when a user

Aptana Studio 3 combine php with html

hi guys am having problems mixing P.H.P code into an HTML file i get error on P.H.P that says missing end tags any help please
I think, you are missing something, either you are not saving the file with ".php" extension.
And also there were some errors in your code. you was putting semicolon at the end of HTML tag. whci is not practiced.
Following is the code which is running successfully.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "w3.org/TR/html4/loose.dtd">
<html xmlns="w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>New Web Project</title>
</head>
<body>
<h1>New Web Project Page</h1>
<?php echo "string"; ?>
</body>
</html>

Why php includes doesn´t processes accents right?

As explained here (PHP Include and accents (They show up as �)) php has a strange behavior processing the accents. My question is Why?
I mean: I have a simple utf-8 charset page. With this:
<!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>My Title</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
</head>
<body>
<?php include ('file.php');?>
The included file just says: "Administración." It has no charset, just header tags (h2, h3...), and some links. Like this:
<h2>Administración</h2>
So, there is no charset conflict. Are not they supposed that the include files are just included?
The previous question was answered with some fix to the problem, but my question is Why PHP behaves this way?
to answer you new questions (from your comment):
How can I do the same thing in other
editors, how do I know the default
charset?
default-charset and charset for every single file can be set in almost every code-editor i know - where exactly depends on the editor. simply take a look into the manual/documentation of your editor for that.

php include not working on IE?

This include is not working in IE:
<?php
include_once 'localization.php';
?>
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Global Colleague</title>
<link href="css/style.css" rel="stylesheet" type="text/css"/><!--Start Kampyle Exit-Popup Code-->
<script type="text/javascript">
Calling an array inside localization.php
<?php echo l('content_p3'); ?>
EDIT: I tried the same file in another folder and it worked
"Not working" is very generic. What is it that you expect and what is actually happening? You may want to turn error reporting on and see if any error is reported. In (X)HTML, nothing should be printed before the doctype. Are you trying to add something to the HTTP response? Typically, the browser shouldn't effect how PHP outputs your code unless you've added some code to respond to the user agent which is not always wise.
Perhaps, when you tried your code in another directory it wasn't able to find the offending script as it is included by a relative path. Try removing the include in the original file and see if it "works".
The following way 100% work for you:
1) Install (Open Source) Notepad++ On your PC
2) Open the file in it
3) Go to encoding and select (Encode in UTF-8 Without BOM)
4) Then click save
5) Now it can work on (Chrome) and (IE)
:)

Categories