Upgrading to v3 damaged my templates... Options
GroennDemon
Posted: Thursday, March 06, 2008 11:28:56 PM
Rank: Aficionado

Joined: 7/30/2006
Posts: 105
I have upgraded to v. 3.0.3 from v. 2.1.6 and suddenly the layout was broken...

It seems like somehow the templates were altered. Somehow the broken layout looks very familiar... I think it's an old version that I had fixed a long time ago.
However, my new macros are still there... any idea what could be causing this?
GroennDemon
Posted: Thursday, March 06, 2008 11:32:58 PM
Rank: Aficionado

Joined: 7/30/2006
Posts: 105
Of course I have created backup copies of both the database and the webspace... where can I find the old templates for comparison and/or restore?
drobar
Posted: Thursday, March 06, 2008 11:44:28 PM

Rank: Umbracoholic

Joined: 9/8/2006
Posts: 1,696
Location: KY, USA
Hi, Marvin,

I haven't had umbraco lose any templates during an upgrade before. But v3 does do something differently than v2 that could be causing the problem.

Look at the HTML source (from your browser) of a page that no longer renders correctly under v3. Look for a div that closes itself. That will break your layout.

In v2, an empty div would generate this code in your html:
Code:
<div></div>


In v3, an empty div generates this code in your html:
Code:
<div />


While the <div /> is valid xml, most browsers don't like it and it breaks your css layout.

Let us know what you find out.

cheers,
doug.

MVP 2007-2009 - Official Umbraco Trainer for North America - Percipient Studios
drobar
Posted: Thursday, March 06, 2008 11:45:43 PM

Rank: Umbracoholic

Joined: 9/8/2006
Posts: 1,696
Location: KY, USA
Well, that didn't format properly... let me try again...


In v2, an empty div would generate this code in your html:
<div></div>

In v3, an empty div generates this code in your html:
<div />



cheers,
doug.

MVP 2007-2009 - Official Umbraco Trainer for North America - Percipient Studios
GroennDemon
Posted: Friday, March 07, 2008 7:31:45 AM
Rank: Aficionado

Joined: 7/30/2006
Posts: 105
Indeed! :)
I was misled my the designer telling me that there were five instead of three stylesheets etc.

Now how can I get rid of those empty div's?
GroennDemon
Posted: Friday, March 07, 2008 12:33:39 PM
Rank: Aficionado

Joined: 7/30/2006
Posts: 105
I had an <div></div> in my XSLT... I've changed it to <div>&nbsp;</div>.
This renders as <div> </div> and the layout works again... Is there a way to get rid of the space?
tkahn
Posted: Wednesday, August 13, 2008 11:02:35 AM

Rank: Fanatic

Joined: 11/24/2006
Posts: 322
Location: Stockholm, Sweden
GroennDemon wrote:
I had an <div></div> in my XSLT... I've changed it to <div>&nbsp;</div>.
This renders as <div> </div> and the layout works again... Is there a way to get rid of the space?


Adding a &nbsp; (non-breaking space) between two div-tags will work. In some cases this messes up your layout though. I haven't found a way to generate a completely empty div-tag, but if you add an XSLT-comment between the opening and closing div-tag, the tags are preserved and render well in most browsers.

In the XSLT script it looks like this:
Code:

<div class="myEmptyDiv">
<xsl:comment>comment</xsl:comment>
</div>


This will render the (X)HTML:
Code:

<div class="myEmptyDiv"><!--comment--></div>


/Thomas K

Web Developer at Kärnhuset - http://www.karnhuset.net - Stockholm, Sweden
drobar
Posted: Wednesday, August 13, 2008 3:21:24 PM

Rank: Umbracoholic

Joined: 9/8/2006
Posts: 1,696
Location: KY, USA
One way to handle this (though it may well cause other problems) is to change your xslt's output to 'html' instead of the default 'xml'. At the top of your xslt file you'll want to change this line:

Code:
<xsl:output method="xml" omit-xml-declaration="yes"/>
     -to-
<xsl:output method="html" omit-xml-declaration="yes"/>


This will let you output empty div's, ul's, etc.

cheers,
doug.

MVP 2007-2009 - Official Umbraco Trainer for North America - Percipient Studios
tkahn
Posted: Friday, August 15, 2008 9:01:48 AM

Rank: Fanatic

Joined: 11/24/2006
Posts: 322
Location: Stockholm, Sweden
Will there be any drawbacks if you change the output method to HTML? If not, why is it not set as default?

Web Developer at Kärnhuset - http://www.karnhuset.net - Stockholm, Sweden
Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.