17488 Posts in 4473 Topics by 1978 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 5523 Views |
-
Validation of SS file

3 June 2008 at 1:02pm
Hi all,
I am a student and for quality assurance part of my project i need to have code validation.
Could any one suggest me how can i can get validate my ss files?I tried with W3C validator but it gives error when ss code comes e.g. <% base_tag %>
Is it possible for any one to check & validate my code & suggest me if i am making some mistakes? -
Re: Validation of SS file

3 June 2008 at 1:32pm
Wh yare you trying to validate the template code before it is parsed?
Shouldn't you be validating the html/css that is being sent to the broswer... ie the html source of http://www.your-silverstripe-site.com/home
-
Re: Validation of SS file

3 June 2008 at 4:23pm
Hi Ian
I had tried with source code also but it gives errors like;
# Line 6, Column 49: end tag for "base" omitted, but OMITTAG NO was specified.
<base href="http://localhost/site_mimomax/" >
You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".
# Info Line 6, Column 4: start tag was here.<base href="http://localhost/site_mimomax/" >
Is it b'cuz i have not hosted my site & it's not localhost?
Does localhost creates errors? -
Re: Validation of SS file

3 June 2008 at 4:57pm Last edited: 3 June 2008 4:59pm
This has nothing to do with localhost. The error message is telling you that the 'base' element is not closed.
With xhtml, all tags (eg <div>) need to be closed (eg </div>). You can have self closing tags, which look like this <img src="something.jpg" />.
The base tag should be self closing... ie <base href="http://localhost/site_mimomax/" />
Note the slash at the end of the tag (in blue).
FYI, my SS instance (2.2.2) is producing valid XHTML (my doctype is 1.0 Transitional)
-
Re: Validation of SS file

4 June 2008 at 10:17am
Hi Ian
Thanks a lot for your co-operation. I still have some doubts. In my view source it comes like;
<!---->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en" >
<head>While in my C:\wamp\www\site_mimomax\tutorial\templates\Page.ss file it's like;
<!--<?xml version="1.0" encoding="UTF-8"?>-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" >How it changes to HTML while it's XHTML in page.ss file?
Right now i have <!---xml ---> statment in only one page.ss file do i need to declare it in page.ss of layout folder also and same in all the .ss file of my layout folder?
Can you guide me further more?
How can i close <% base_tag %> tag? In tutorial 1 I didn't find any clue how to close it. I tried with <% base_tag % /> & < / % base_tag %> but it comes as text on html page.
-
Re: Validation of SS file

15 July 2008 at 6:27pm
I believe you can manually assign the href to the base tag, such as:
<base href="$BaseHref"></base>
instead of ... <% base_tag %>
Cheers,
Sean
| 5523 Views | ||
|
Page:
1
|
Go to Top |


