umbraco6 - Umbraco.TypedContentSingleAtXPath always giving wrong ID -


umbraco version 6.1, visual studio 2010

i'm trying list of newsarticles under news folder in umbraco i.e.

-news --newsarticle1 --newsarticle2 

my code

var doctype = "documenttypename"; var parnode = umbraco.typedcontentsingleatxpath("//" + doctype);  list<ipublishedcontent> child = parnode.children.tolist(); 

when line hit

var parnode = umbraco.typedcontentsingleatxpath("//" + doctype); 

it gives me wrong parnode (parent node is) id. finds correct doc type (as if change name error).

i've tried rebuilding, cleaning project doesnt work. other folders using same code work dont know or whats going wrong?

any thoughts?

if it's giving wrong content node, may have 2 or more content nodes of same contenttype (doctype).

typedcontentsingleatxpath return first valid match , ignore subsequent nodes. can verify results checking required node first 1 of it's type in published cache (the ~/app_data/umbraco.config file).


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -