Getting name of the node

Ei Dar Li Ko Ko asked on January 28, 2015 10:52

HI... I am working on a blog to retrieve exactly the name of that particular blog to show on the web part my sql is "SELECT TOP 1 * FROM customtable_blog WHERE CHARINDEX('/'+REPLACE(REPLACE(REPLACE(LOWER(BlogName), '''', ''), '&', '-'), ' ', '-')+'/','" + DocumentContext.CurrentDocument.NodeAliasPath + "/') > 0" but I am not getting any characters index. Pls do advice.

Recent Answers


Brenden Kehren answered on January 28, 2015 13:25

Why not use the built-in API to get it?

var blogs = BlogHelper.GetBlogs(SiteContext.CurrentSiteName, 0, null, null, "BlogName = 'Your Blog Name'"); // not NodeAliasPath
foreach(DataRow dr in blogs.Tables[0].Rows)
{
    string blogName = ValidationHelper.GetString(dr["BlogName"], "");
}
0 votesVote for this answer Mark as a Correct answer

Ei Dar Li Ko Ko answered on January 29, 2015 09:06

I just want to find the name from the customtable with the charindex inside the node in the content tree. Can you suggest me an sql function.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.