Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi All,
I looking for a way to retrieve all my dictionary items from a locale.
I've got my dictionary items setup like so:
dictionary-- section 1 -- dictionary 1 -- dictionary 2 -- dictionary 3-- section 2 -- dictionary 1 -- dictionary 2-- section 1 -- dictionary 1 -- dictionary 2 -- dictionary 3 -- dictionary 4 -- dictionary 5
I know I can use GetDictionaryItems("section 1") and that will retrieve me all the items under section 1 but I want to get everything under the dictionary. Does anyone have any idea on how I can achieve this?
Thanks,
Tom
try:
foreach (cms.businesslogic.Dictionary.DictionaryItem d in cms.businesslogic.Dictionary.getTopMostItems) { if(d.hasChildren) { foreach(cms.businesslogic.Dictionary.DictionaryItem d1 in d.Children) { Response.Write(d1.Value(1) + "< br/>"); } } }
where 1 in "value( )" means languageId.
Cheers, I'll give that a go.
Hi , Tom.
Remember to mark as "solved" if your problem is solved.
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Get all dictionary items in c#
Hi All,
I looking for a way to retrieve all my dictionary items from a locale.
I've got my dictionary items setup like so:
dictionary
-- section 1
-- dictionary 1
-- dictionary 2
-- dictionary 3
-- section 2
-- dictionary 1
-- dictionary 2
-- section 1
-- dictionary 1
-- dictionary 2
-- dictionary 3
-- dictionary 4
-- dictionary 5
I know I can use GetDictionaryItems("section 1") and that will retrieve me all the items under section 1 but I want to get everything under the dictionary. Does anyone have any idea on how I can achieve this?
Thanks,
Tom
try:
foreach (cms.businesslogic.Dictionary.DictionaryItem d in cms.businesslogic.Dictionary.getTopMostItems)
{
if(d.hasChildren)
{
foreach(cms.businesslogic.Dictionary.DictionaryItem d1 in d.Children)
{
Response.Write(d1.Value(1) + "< br/>");
}
}
}
where 1 in "value( )" means languageId.
Cheers, I'll give that a go.
Tom
Hi , Tom.
Remember to mark as "solved" if your problem is solved.
is working on a reply...