Hi I'm trying to show the lastest news item [doctype NewsItem] on all pages, but its currently not working and if possible show a featured news item is the they dont want the lastest..
Thanks for that, but its still not working. I'm still getting a blank area. Just to confirm incase I'm getting this wrong (still a noob) NewsItem is the Doc type of the item i want shown on a page.The news i want shown are in Home > News > news title .
Ahh, ok, maybe try changing your selector in your for-each to something like:
$currentPage/ancestor-or-self::root//* [name() = $documentTypeAlias and string(umbracoNaviHide) != '1']
This should go from the current page, back down to the root, and then look for any NewItem at any level that isn't set to hide. It should then sort them by date descending, and select the top 1 (ie the latest).
get featured news item or default to latest item
Hi I'm trying to show the lastest news item [doctype NewsItem] on all pages, but its currently not working and if possible show a featured news item is the they dont want the lastest..
my code looks like this
Every section i have this marco on is blank
Hi Ivor,
Give this a try
Matt
Hi Matt,
Thanks for that, but its still not working. I'm still getting a blank area. Just to confirm incase I'm getting this wrong (still a noob) NewsItem is the Doc type of the item i want shown on a page.The news i want shown are in Home > News > news title .
Ahh, ok, maybe try changing your selector in your for-each to something like:
This should go from the current page, back down to the root, and then look for any NewItem at any level that isn't set to hide. It should then sort them by date descending, and select the top 1 (ie the latest).
Give that a try and let me know if it works
Matt
Great, Thanks Matt, That worked, now just need to hook up the featured functionality.
Sweet, let me know if you have any probs
Matt
is working on a reply...