How to modify the HTML tag in Drupal 6? - drupal-6

I am new to Drupal and I need to add an attribute to the HTML tag, but I cannot find the way. Thank you for the help.

This probably depends in part on your theming mechanism. However, the doctype and html tags are likely hard-coded in page.tpl.php or similar (located in sites/all/themes/themename). The exact file will depend on your theme.
For example, I have a site with the following in page.tpl.php:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php print $language->language; ?>" lang="<?php print $language->language; ?>" dir="<?php print $language->dir; ?>">
As you can see, there is some information being injected by PHP. This would be the place for you to make your change.

Related

Kentico - different DOCTYPE on different pages

I've just realized that some of my pages have a long DOCTYPE, but most pages have the short DOCTYPE like below. I never add this details myself and in all my Master Pages, I don't see/add the DOCTYPE details. My question is how the DOCTYPE got added and how to make all pages use the same short DOCTYPE. I believe the long DOCTYPE may be the cause to mess up some of my navigation for mobile. Thanks for your input!
<!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" >
<!DOCTYPE html>
<html >
The DOCTYPE is set in the main portal template when using the PortalEngine in Kentico with the code <%=DocType%>. This value comes from the Master page tab inside the Pages application. You can see an example of this on the Creating the master page tutorial in the Kentico documentation.
It's the first field on the tab that you can edit, so you should just be able to set the value to <!DOCTYPE html>.
As far as I am aware, each page that has a master page can specify its own document type, so check out each of your master pages. I think if you check out the link about, this will help you out.
It's also worth checking that no-one has edited the file CMSPages\PortalTemplate.aspx (this is the base for PortalEngine pages). For reference, the beginning of the file normally looks as follows (in Kentico 10):
<%# Page Language="C#" AutoEventWireup="true" Inherits="CMSPages_PortalTemplate"
ValidateRequest="false" MaintainScrollPositionOnPostback="true" EnableEventValidation="false"
Codebehind="PortalTemplate.aspx.cs" %>
<%=DocType%>
<html <%=XHtmlNameSpace%> <%=XmlNamespace%>>
To add to what Matt has said, if your not using Portal method then the changes could be in several different aspx files in the CMSTemplates directory. These templates would have that namespace defined in them if they were a master page template.
<!DOCTYPE html>
add above doctype in very first line of your master page.
refer below link.
https://docs.kentico.com/k9tutorial/creating-the-master-page
hopes it will help

How do I get the "HTML 4.01 Strict" doctype in Express/Jade?

I'm migrating old sites to Express/Jade having the "HTML 4.01 Strict" doctype. I want to keep this doctype for now.
How do I get this doctype in Express/Jade?
"doctype strict" only provides the XML type, not HTML.
Of course I can type the doctype manually, but this doesn't work because Jade will insert an extra "/" at the end of each HTML element in the rest of the document (as if the document was XML), which leads to validation errors.
doctype strict
Will give you:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
I believe that is the closest you could get.
P.S.: If you're migrating, why not change, since you have to touch it anyway?
Doctype only get IE out of quirks mode. Otherwise, they are basically ignored by browsers. Only a xhtml doctype is different as it could be parsed as XML with different parser. But from the browser stand point, as long as you have a doctype (no mather which one), it'll work.
Although, in Jade, you can:
# doctype <anything>
doctype HTML 4.01 Strict

Can we include angularjs component in Facelets page

I am new to angularjs, and was trying to create a sample angularjs in a Facelets file. But I am getting an error in the line <html ng-app> in Eclipse IDE. The error specifies that the ng-app attribute should be followed by an = character. Is it not possible to include angularjs code in a Facelets XHTML file?
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns:ng="http://angularjs.org" ng-app>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script>
</head>
<body>
<div>
<label>Name:</label>
<input type="text" ng-model="yourName" placeholder="Enter a name here">
<hr>
<h1>Hello {{yourName}}!</h1>
</div>
</body>
</html>
Take a look at following:
Try angular faces: https://github.com/stephanrauh/AngularFaces
And there is also a project: https://github.com/pankajtandon/PointyPatient
Prime faces refer to: http://angularprime.appspot.com/#/main
The best way is to go with HTML & JS as Client, and JAX-RS on Server Side.
I had similar problems, with Primefaces and Bootstrap, and became convinced, that JS & HTML at the moment is better for client side development.
Give the attribute the ng-app.
The value of the attribute would be the same as the name of variable that contains the return value of angular.module().
for ex:
ng-app="SampleApp"
in the html page
var SampleApp = angular.module("SampleApp", ["ngResource"]).
config(
//your code
);
in the app.js file
I think this should work for you.
The logic is that, when you define the ng-app it gives the reference to the particular module of app.js that would call the relevant controllers.
There is an app.js file in angularjs. This contains all the controllers define. These controllers act as connecters and data pipeliners between the html(our view) and the .cs(mvc controller) files.
These controllers are defined in a module (as i have defined one in the above answer).
There can be numerous modules in app.js. and hence they wil have numerous controllers.
ng-app is a directive that contains the name of the module you want to use as attribute.
ng-app defined will be active till the closing tag of the tag defined. That means if you have defined ng-app in html tag, it will work till the html tag closes, if in a div, it will work for that division.
If you dont get anything, google it, or refer the angularjs documentation, or shoot me a question.!!
I hope you got something out of it.:-)
Stumbled on this while searching myself.
XHTML does not allow an attribute without a value. While you can ignore this in Eclipse, the latest JSF libraries blow up and you'll get an exception.
Specify a value, which corresponds to your module name. For example, if you initialize your angular module with:
var myAppModule = angular.module('myApp', []);
Then you need to specify:
<html ng-app="myApp">
And all should be good minus some warnings in eclipse for not recognizing "ng-app". Works for me. Also, you probably want the HTML 5 doc type instead of the strict you have. Try:
<!DOCTYPE html>
<html ng-app="myApp">

Error Parsing /page.xhtml: Error Traced[line: 42] The entity "nbsp" was referenced, but not declared

I'd like to use non breaking spaces in my JSF page. I know, in plain HTML I could use for this and this works fine. However, when I put those in a Facelets page, then it errors as follows:
Error Parsing /page.xhtml: Error Traced[line: 42] The entity "nbsp" was referenced, but not declared.
How is this caused and how can I solve it?
Facelets is a XML based view technology. XML has only five predefined entities. The is not among them. It works only when used in plain HTML or in legacy JSP (note: it doesn't work in JSPX as that's also XML based!).
To fix this, you either need to declare the entity yourself in the doctype of the very XHTML file containing the entity,
<!DOCTYPE html [
<!ENTITY nbsp " ">
]>
or, better, use the (hexa)decimal notation instead:
  or  
In an average IDE it should be trivial to perform a "find and replace in all files" and replace every occurrence of by  .
Try using &#160;. for more information on entities you can refer following url HTML ISO-8859-1 Reference
For me the following doctype enables :
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<![CDATA[ ]]> should work fine. This does not work inside attribute value, though.
Alternatively, as long as & is a predefined entity in XML, you could try &nbsp; - worked for me with XML based JSP. This should work within attributes as well.
add
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
to the top of the file

how to redirect html into a url

I am not sure if this is possible.
This is the name of the site:
www.mysite.com
and I created an html (named index.html) & saved it to the folder myfile which is a redirect to this site www.mysite.com/myfile
Now on the site, I have a content here that if you click on it, it will direct you to this:
www.mysite.com/documentation
Now the redirect html I made, I would like it to be redirected to the documentation
so that if you click on www.mysite.com/myfile - it will open the www.mysite.com/documentation but this documentation is not an html its inside the cms.
Is that possible?
Btw here is the html code I saved in the index.html. Do I have to insert the url here:
www.mysite.com/documentation?
CONSTRUCTION PAGE
Is this what you need?
<meta HTTP-EQUIV="REFRESH" content="0; url=http://www.mysite.com/documentation">
I have trouble understanding your question correctly. So I am unsure if this will help you.
Edit for valid 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>
<title>Redirect</title>
<meta http-equiv="REFRESH" content="0; url=http://www.mysite.com/documentation" />
</head>
<body>
</body>
</html>
Use document type weblink on modx
As Gus suggested, use a weblink.
Create a new weblink with alias myfile, and the content should be a link to www.mysite.com/documentation.
Then if you visit www.mysite.com/myfile it will take you directly to www.mysite.com/documentation.
For more info: http://rtfm.modx.com/display/revolution20/Weblink
As the others have already said, a weblink in modX would be the way to go.
I answered this already in more detail in your other question with essentially the same topic.

Resources