Your code should be working, if your Portfolio items are published. Can you make sure that all the portfolio items are published? Right click on your portfolio node and select Publish, and tick both checkboxes saying "Publish ... and all its subpages" and "Include unpublished child pages".
I copied your code and pasted into an existing project and that works fine.
Here is your code but stronly typed:
Glad i could help Callum. Those things happens! :)
Personally I prefer Strongly Typed, especially with Visual Studio and intellicense. But if you are new to Umbraco and you feel comfortable with Dynamic, then I dont want to be the "dont-do"-guy. :)
Why isn't CurrentPage.Children returning the children?
Code I'm using shown below, something's wrong.
So that's my code above, I have a Portfolio landing page which has children in a list view which are portfolio items.
So it's in a blog format. But I can't seem to get these children for whatever reason.
What am I doing wrong?
Thanks in advance
Hi Callum.
Your code should be working, if your Portfolio items are published. Can you make sure that all the portfolio items are published? Right click on your portfolio node and select Publish, and tick both checkboxes saying "Publish ... and all its subpages" and "Include unpublished child pages".
I copied your code and pasted into an existing project and that works fine. Here is your code but stronly typed:
If it still does´nt work, I can take a look at it if you want, if you have a dev enviroment.
Take care / Dennis
I'm an idiot!! They weren't published, works fine now.
Thanks Dennis!
Also while you're here...
Should I be using Strongly Typed instead of Dynamic?
I have heard it's better but I personally have found Dynamic much easier to use.
Glad i could help Callum. Those things happens! :)
Personally I prefer Strongly Typed, especially with Visual Studio and intellicense. But if you are new to Umbraco and you feel comfortable with Dynamic, then I dont want to be the "dont-do"-guy. :)
I really recommend reading this article by Dave Woestenborghs about Stronly typed vs. Dynamic: http://24days.in/umbraco/2015/strongly-typed-vs-dynamic-content-access/
Read it, and then choose whatever approach that feels best for you.
Have a great day!
is working on a reply...