I'm trying to get a list of sub items from preceding siblings and am nearly there but the code also gets all earlier versions of the subpages as well.
Level1 Page 1 item A v1 (old) (not visible in content) item A v2 (current) Page 2 item B v1 (old) (not visible in content) item B v2 (old) (not visible in content) item B v3 (current) ... Page N
I run my code from Page N and want to see:
item A v2 (current) item B v3 (current)
But see:
item A v1 (old) item A v2 (current) item B v1 (old) item B v2 (old) item B v3 (current)
If you're seeing old versions alongside the new ones, there's something wrong with XML cache - are you getting duplicate ID's in the output if you print them (i.e. with the <xsl:value-of /> instruction)? And how about the updateDate ? Try this:
I could check the date and set only the first one but I don't have this problem on other XSLT files. I'm sure it's related to the '/child::* ' element and with the right syntax it should only list the ones at the top of the version list.
I have printed the Ids and they are the same for the different versions. Raising the idea of a corrup XML cache does make me think, I have changed the docType definition on these items and maybe they are 'seen' as 2 distinct items, I will test this and get back to you.
Thanks guys, it is a corrupt xml cache. The changes I've made in the item docType has generated some 'orphan' versions of the items. Having deleted the items, created new ones and then newer versions I now only see the latest versions. However the orphan versions still appear in the output although they are not in the content. I assume I can clear the XML cache somehow?
XSLT showing all previous versions of a document
Hi,
I'm trying to get a list of sub items from preceding siblings and am nearly there but the code also gets all earlier versions of the subpages as well.
I run my code from Page N and want to see:
item A v2 (current)
item B v3 (current)
But see:
item A v1 (old)
item A v2 (current)
item B v1 (old)
item B v2 (old)
item B v3 (current)
The code fragment is:
<xsl:for-each select="$currentPage/preceding-sibling::*/child::* [@isDoc][string(umbracoNaviHide) != '1']">
I'm sorry if this is something simple but I can't get my head around it.
Thanks if you can help.
Roger
Hi, you could sort by updateDate or createDate and display only the first one.
Hi Roger,
If you're seeing old versions alongside the new ones, there's something wrong with XML cache - are you getting duplicate ID's in the output if you print them (i.e. with the <xsl:value-of /> instruction)? And how about the updateDate ? Try this:
If you're getting duplicate ID's there's a mouse in your XML cache...
/Chriztian
Hi,
I could check the date and set only the first one but I don't have this problem on other XSLT files. I'm sure it's related to the '/child::* ' element and with the right syntax it should only list the ones at the top of the version list.
I have printed the Ids and they are the same for the different versions. Raising the idea of a corrup XML cache does make me think, I have changed the docType definition on these items and maybe they are 'seen' as 2 distinct items, I will test this and get back to you.
Hi,
Thanks guys, it is a corrupt xml cache. The changes I've made in the item docType has generated some 'orphan' versions of the items. Having deleted the items, created new ones and then newer versions I now only see the latest versions. However the orphan versions still appear in the output although they are not in the content. I assume I can clear the XML cache somehow?
Anyway thanks for replying.
Roger
Hi Roger,
I once heard that going to /umbraco/dialogs/republish.aspx?xml=true will refresh the XML cache (incl. Media XML) so maybe try that...
/Chriztian
You're spot on Chriztian, that worked perfectly. Thanks very much.
is working on a reply...