Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: Find the right Doctype
@ Maruchan, good point, will study XHTML, thanks for the help so far, will have a look at those lasts points!
@ Els, it’s not about <> in articles, but just basic XHTML tags (in pages/forms), for example in the head section. The W3C validator (see first post) somehow classifies them as illegal characters and hence, errors… don’t know exactly why.
Offline
#14 2011-10-19 15:41:06
- GugUser
- Member
- From: Quito (Ecuador)
- Registered: 2007-12-16
- Posts: 1,477
Re: Find the right Doctype
sidekarsten schrieb:
I know that there is a lot that is probably not used or is incorrect, but so far the website does what I want it to do, cross-browser above all, so hey, I’m happy with that.
Many years ago, Stefan Münz (German) published his extensive website SELFHTML under the slogan “the power of understanding”. His work was a milestone for a generation of german-speaking web designers. What you are doing is the opposite, copy and paste, without trying to understand. I think this forum should not be here to show you one by one any incorrectly placed signs in order to pass the W3C test. The problem is not the correct or incorrect doctype, as you suggest in the title, or the W3C test. The problem is chaotic XHTML, CSS and JS. That’s what you should work and learn to understand. I disagree with your point of view. We can learn from what we do and improve our work. (I have to improve my english ;-) .)
Offline
Re: Find the right Doctype
1. Regarding the part where you have used…
<script>
!window.jQuery && document.write('<script src="tools/jquery-1.4.3.min.js"><\/script>');
</script>
…that is usually used in conjunction with a CDN version of jQuery – as a local fallback in case the CDN is offline, correct usage would be something like this (with TXP tags)…
<!-- jQuery - load from Google CDN first, load locally if CDN is unavailable -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="<txp:site_url />js/jquery.js"><\/script>')</script>
2. You need to provide alt
attributes for any images (and remove any title
attributes from those images as that method of SEO is obsolete now).
3. Since you are using XHTML you need to specify <script type="text/javascript">
not just <script>
, that is HTML5 instead.
4. Check that all you HTML tags close properly, and in the right order. All tags apart from self-closing tags (which end in />
) have to be closed properly with a corresponding end tags.
For example:
<ul><li><a href="url-here">some text here</a></li></ul>
Offline
Re: Find the right Doctype
@ Guguser, well, I posted this because I thought something was wrong with the doctype, this was not the case, in fact there were many errors on my part. Several were indicated by the helpful comments above, and I learned from them.
However, following your argument, you say one should only make a website when one fully and completely understands everything there is to know about webprogramming… well, that may be your opinion, but I would suggest the opposite. I would recommend to everyone to get involved, to try things out, and learn while you go along. Also, if we only do things we fully understand, there would be no use for any forum, would there?
Also you accusations are simply wrong. I do not copy paste things without being willing to understand how they work, in fact, I do understand pretty much most of what I did, that’s why the website works in the first place… there are just a few elements that I don’t really understand yet and for which I humbly ask your help. Whether or not you or others want to provide that help is entirely up to you, that’s how a forum works. You may simply ignore me. Luckily others provided valuable comments which I gratefully took notice of, learned from, and used to improve my site.
@philwareham thanks for the tips, I’ll go to work!
Offline
Re: Find the right Doctype
@ maruchan, there are many books on XHTML, is there any one in particular you (or others) would recommend?
Offline
#18 2011-10-23 00:49:48
- GugUser
- Member
- From: Quito (Ecuador)
- Registered: 2007-12-16
- Posts: 1,477
Re: Find the right Doctype
sidekarsten schrieb:
(…) you say one should only make a website when one fully and completely understands everything there is to know about webprogramming.
That’s what I said? When? Where?
That’s not what I think! … ;-)
Also you accusations are simply wrong.
Accusations? I don’t accusing you. This here isn’t a war. I found and mentioned that you’ve copied large parts of the fancybox website and reused it. I mentioned as an example: “The code between the lines 81-340 is taken from there and does not make sense for your site.” Or where you have id="example2"
or id="example3"
etc.?
Your answer was: “When I need these things, I copy paste and hope that it works … I know that there is a lot that is probably not used or is incorrect, but so far the website does what I want it to do, cross-browser above all, so hey, I’m happy with that.” You said that you “hope” and that you are “happy” if it works. At that moment I didn’t get the impression that you wrote something in the sense to “be interested to learn”. If it had not been the startling result of the W3C Validation … I think you would have been satisfied with your work.
And by the way: If you want to enhance your knowledge, then I suggest you familiarize yourself with HTML 5 instead of XHTML.
Offline
Re: Find the right Doctype
@Karsten
As also mentioned by GugUser, don’t concentrate too much on XHTML – get a book on HTML in general (of which XHTML is a subset). HTML5 in particular is the latest iteration and the code has been simplified somewhat from previous versions. Any of the O’Reilly books should be of high standard.
Offline
Re: Find the right Doctype
Ok Great, will look into that… /
@ Guguser, ok I Will… suppose we were a bit lost in translation. The code you mention by the way is indeed something I don’t use at the moment, but as it was there already I just left it there so I can easily use it if I want to, as a sort of library. Perhaps better to get it out, but I thought I would just leave it there and call on it when I want to use it. I was planning to use these things for some image galleries in the near future.
I was indeed quite happy that everything seemed to work properly (even in IE!!), but then the W3C validation indeed showed that there were some errors. I couldn’t quite work out what was exactly was wrong, so I posted this thread… as I wanted to learn and improve :)
6 months ago I didn’t even know XHTML or HTML5 existed, so I’m on a steep learning curve, which is not easy when you have a full-time job which focusses on research on Stone Age burial rituals and in the mean time also try to run a publishing house aimed at providing free global access to scientific books… :) We didn’t have money to hire a proper web designer, so I’m quite happy with what I could do myself, as everything does seem to work, despite the W3C errors :)
@ Phil, thanks, will have a look at those books! Just ordered the one you suggested!
For now the site is running and is in the air. I will read up on (X)HTML and try to improve the coding as we go along. Any further tips are of course always appreciated.
Offline
Re: Find the right Doctype
but I thought I would just leave it there and call on it when I want to use it.
Karsten,
You could enclose unused code using the hide tag ie
<txp:hide> code to hide </txp:hide>
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: Find the right Doctype
@ Colak, Haha, that’s right! Will do that, didn’t think about that, that’s ideal! Much of the unused java is now hidden, thanks!
I now have some of the java in a separate form, so I can easily adjust parameters directly from Textpattern. I learned that you can also put the java in “styles” and call it in from there as you would a style-sheet, but didn’t really get that to work. In either case I suppose it is not what you should really do (put in in a separate file which you upload with FTP, which I did with most other that do not constantly need adjusting/tweaking).
This would perhaps be a nice addition to TXP, a form/style type of tab where you can put all “external” files such as java.
Last edited by sidekarsten (2011-10-23 12:19:36)
Offline
Re: Find the right Doctype
sidekarsten wrote:
6 months ago I didn’t even know XHTML or HTML5 existed, so I’m on a steep learning curve
Well, that’s very impressive work for such a short amount of time, keep at it! FWIW I’ve been doing HTML/CSS stuff for about 12 years now and I’m still learning.
Offline
Re: Find the right Doctype
@ Phill, where is the “like” button in this forum? :)
had some basic knowledge about HTML and CSS but not properly. Also am a newbie to Textpattern, so current site is my first TXP project. Now planning a new one by the way, but will perhaps first look through the HTML5 book I just ordered. However, for the time being I suppose we cannot really use HTML5 as the older browser will probably not support it? Work at Leiden University and we’ve just had a University-wide ICT upgrade, we now all use IE7 !! AAAARRGGH WHY???? But so do many companies unfortunately, so CSS3 is also not really an option for at least some years to come.
Offline