I'm sorry if this is very simple but i've spent longer than necessary trying to list the hidden pages of current page.
They are news items that i have hidden from the main navigation but want to display as a sidebar on the news page where i have the news items paginated.
The List Sub Pages From Current Page works when not hidden and i thought by changing this line :
<xsl:for-each select="$currentPage/* [@isDoc and string(umbracoNaviHide) != '1']">
to
<xsl:for-each select="$currentPage/* [@isDoc and string(umbracoNaviHide) = '1']">
I just tried this on one of my solutions, and when I use the following XSLT, it´s list the pages of current page which has the UmbracoNaviHide sets to true.
When i visualize the xslt it works fine but will not display on my frontend, no errors show. On the same page i have an xslt that displays the news items in full and have one per page. This works fine so i can't see why it would affect it.
I've just taken the other xslt off the page and it still isn't working so i guess i can rule that out. I don't know why it isn't working on the page when it visualizes fine. hmm
There must of been a slight spelling out in the title display on my part it is working great now thank you.
Would you know about pagination in xslt ? Or is it worth me starting a new topic? I have pagination for my new items but when my news items finish the next button doesn't disappear so it carries on showing empty pages everytime it is clicked. The test for it looks fine.
Good to hear that you manage to solve you, problem.
I think the best way is to keep one issue on one thread. So my advice would be start a new topic with the pagination question. Then people easier can see what the topic is about and the issue. But when it has been said. (No rulewithout exception :) )
Don´t know if you use or have seeen Chrizitan´s pagination in XSLT, I don´t know if this can help you in some way,
Often the easiest way of solving an XSLT problem is making sure the numbers are right, you could try debugging your pagination quickly...
Add a textarea and spit out the values...
<textarea> number of records <xsl:value-of select="$numberOfRecords" />, records per page <xsl:value-of select="$recordsPerPage" />, etc.... </textarea>
I'd check that $numberOfRecords is correct.
It could be that you are counting bits of XML that are 'child' elements of the page.
Could be a case of adding a [@isDoc] into your XPATH so you are only counting pages (not MNTP's, DAMP's, etc)
Thanks Laurence, I've just added that textarea and it says i have number of records = 11 and i'm displaying 1 per page. so i added the isDoc (hopefully in the correct way)
<xsl:for-each select="$currentPage/newsItem [string(data [@isDoc and @alias='umbracoNaviHide']) != '1']">
List hidden sub pages from current page
Hi
I'm sorry if this is very simple but i've spent longer than necessary trying to list the hidden pages of current page.
They are news items that i have hidden from the main navigation but want to display as a sidebar on the news page where i have the news items paginated.
The List Sub Pages From Current Page works when not hidden and i thought by changing this line :
Hi Molly,
I just tried this on one of my solutions, and when I use the following XSLT, it´s list the pages of current page which has the UmbracoNaviHide sets to true.
I hope this also will work for you.
/Dennis
Thanks Dennis.
When i visualize the xslt it works fine but will not display on my frontend, no errors show. On the same page i have an xslt that displays the news items in full and have one per page. This works fine so i can't see why it would affect it.
Thanks
Molly
I've just taken the other xslt off the page and it still isn't working so i guess i can rule that out. I don't know why it isn't working on the page when it visualizes fine. hmm
Hey Molly,
What happens if you try this?
Note, there should be spaces between the select (darn editor)
Okay sounds wired, when I try with the code in my post.
I get the nodename on the nodes that have umbracoNaviHide set to true. And it´s displays fine on the frontend of my site.
But you could try what Rich says, and see if you get any data out.
/Dennis
Thank you for your help.
There must of been a slight spelling out in the title display on my part it is working great now thank you.
Would you know about pagination in xslt ? Or is it worth me starting a new topic? I have pagination for my new items but when my news items finish the next button doesn't disappear so it carries on showing empty pages everytime it is clicked. The test for it looks fine.
Thanks
Molly
Hi Molly,
Good to hear that you manage to solve you, problem.
I think the best way is to keep one issue on one thread. So my advice would be start a new topic with the pagination question. Then people easier can see what the topic is about and the issue. But when it has been said. (No rule without exception :) )
Don´t know if you use or have seeen Chrizitan´s pagination in XSLT, I don´t know if this can help you in some way,
https://github.com/greystate/Greystate-XSLT-Helpers/tree/master/paginationhelper
/Dennis
Hi Molly,
Often the easiest way of solving an XSLT problem is making sure the numbers are right, you could try debugging your pagination quickly...
Add a textarea and spit out the values...
I'd check that $numberOfRecords is correct.
It could be that you are counting bits of XML that are 'child' elements of the page.
Could be a case of adding a [@isDoc] into your XPATH so you are only counting pages (not MNTP's, DAMP's, etc)
:) Hope that helps in a round about way! Lau
Thanks Dennis, I'll have a look at that link
Thanks Laurence, I've just added that textarea and it says i have number of records = 11 and i'm displaying 1 per page. so i added the isDoc (hopefully in the correct way)
<xsl:for-each select="$currentPage/newsItem [string(data [@isDoc and @alias='umbracoNaviHide']) != '1']">
Sorry i've done it. Thank you very much. I'd place the [@isDoc] in wrong place. Corrected place
<xsl:variable name="numberOfRecords" select="count($currentPage/* [@isDoc])"/>
I really appreciate everyone's help :D
Hi Molly,
Try this one.
/Dennis
Okay I was too slow :)
Good that you find the right XPath Molly.
/Dennis
is working on a reply...