I spent half an hour the other day pulling my hair out trying to track down the source of a rogue <p> element that was screwing with a page's layout. Well, I deserved a good kicking for not having known what the problem was straight-away. It was, of course, Domino!
As you all probably know by now I like to create as much of the HTML as possible by myself. I don't like Domino doing it for me. If you've seen any of the downloads on this site you'll have seen that all my forms are full of PassThru HTML. Basically, this is as close as you can get to making your own pages without using "Treat page contents as HTML", which is all but useless. Well, the problem is that Domino still manages to squeeze some of its own HTML in there. Take the situation shown below for example:
Imagine this field has to not be PassThru HTML, for one reason or another. So, it's on its own line that isn't marked as HTML. The problem comes about depending on the way you achieve this. Say you write all the HTML and then add the field. Then you mark the lines above and below the field as "passthru". This is when you would get the P tag appearing, after the </label> and before the <input>. Why? Because of the line-break between them! Domino take this new line and renders it in the browser as a <p>. Stupid, I know. If there were two new lines then I'd understand. With one new line would not a <br> make more sense?
Anyhow, the solution: if ever you need/want to have some none PassThru (PT) HTML in among all your other PT make sure you create the new line within the PT and end it on the next linem, as below:
Can you see how the PT carries down a line, continues for a few spaces and then gets turned off? We then then have the none-PT stuff and a few more spaces* of PT so we can have another new line. Alternatively you can simply have it all happen on one line, as below, but this isn't always pretty:
Luckily, there aren't ever that many occasions when you need to come out of PT-mode. Sometimes you have to though. For example, when adding categorised views. When you do need to, be careful how you go. Don't let Domino create any more HTML than it has to.
* Like nature abhors the vacuum, HTML abhors the space. Add as many spaces as you like in a line, they won't render in the browser!