I like the feature that you are able to query the umbraco.config xml file found in App_Data folder but I would like to do it case-insensitive and I havent solved that yet.
foreach(var item in Umbraco.TypedContent(1320).Children.Where("Name = \""+nodename+"\"")){ // Get One node here }
I have a node with name SharePoint in my umbraco instance and that node is store inside umbraco.config as:
<AffarssystemBuzzWord id="1345" parentID="1320" level="3" creatorID="0" sortOrder="59" createDate="2013-11-12T20:36:09" updateDate="2015-02-28T12:35:07" nodeName="SharePoint" urlName="SharePoint" path="-1,3263,1320,1345" isDoc="" nodeType="1319" creatorName="[email protected]" writerName="[email protected]" writerID="0" template="1323" nodeTypeAlias="AffarssystemBuzzWord"> <umbracoNaviHide>0</umbracoNaviHide> <sortOrderMain>1</sortOrderMain> <buzzWord>SharePoint</buzzWord> <description><![CDATA[<p>Är Microsofts plattform för att skapa intranät som jobbar och fungerar bra tillsammans med övriga affärssystemet.</p>]]></description> </AffarssystemBuzzWord>
I could rewrite the umbraco.config so that the file has lowercase entries everywhere on the nodeName attribute but I was looking for a nicer solution. Any ideas?
I am using Umbraco v6.2.5 (Assembly version: 1.0.5529.18434) Mvc config
When looking at the searchbox in the admin interface then that search trhough the nodes are actually case-insensitive. How is that done and were can I find that piece of code?
querying node names case-insensitive?
I like the feature that you are able to query the umbraco.config xml file found in App_Data folder but I would like to do it case-insensitive and I havent solved that yet.
I have a node with name SharePoint in my umbraco instance and that node is store inside umbraco.config as:
I could rewrite the umbraco.config so that the file has lowercase entries everywhere on the nodeName attribute but I was looking for a nicer solution. Any ideas?
I am using Umbraco v6.2.5 (Assembly version: 1.0.5529.18434) Mvc config
When looking at the searchbox in the admin interface then that search trhough the nodes are actually case-insensitive. How is that done and were can I find that piece of code?
I solved it by loading the umbraco.config like a xml document and querying it by Linq:
private string getMyNodeidByLinq(XDocument umbracoConfigXml,string nodeName)
{
string nodeid = "";
var umbracoNodesCities = from umbNode in umbracoConfigXml.Descendants("City")
orderby umbNode.Attribute("id").Value descending
where umbNode.Attribute("nodeName").Value.ToLower() == nodeName
select umbNode.Attribute("id").Value;
if (umbracoNodesCities.Count() > 0)
{
nodeid = umbracoNodesCities.First();
}
}
is working on a reply...