I'm using this in the root of a structure to try and get the count of entries in another part of the structure.
{% set count = craft.entries.section('hotelDetails').descendantOf('oakview-hotel').level(3).type('review').total() %}
{{ count }}
But it's including entries from other hotels, I hoped descendantOf('oakview-hotel') would restrict the count to only oakview-hotel. When I replace escendantOf('oakview-hotel') with descendantOf(17) 17 being the ID oakview-hotel the count is restricted to oakview-hotel and the entry count is correct.
Ca anyone please telly me why descendantOf('oakview-hotel') isn't working for me or suggest a better way to do this?