Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Language and In...Language and In...GetTabByName and CultureGetTabByName and Culture
Previous
 
Next
New Post
9/23/2014 7:19 AM
 

I don't know if this is the correct approach... So...

Our site is multilingual, actualy 8 languages.

In some modules, I need to get the FullUrl of tabs, in order to redirect users there for example.

When I am in any page, in en-GB culture, and executing ti = tc.GetTabByName("Home", this.PortalSettings.PortalId), I am getting the correct tab. However, when I am executing this from any other culture, I am getting the en-GB tab. All tabs have the same name (Home), but different Titles (Home, Αρχική, Pagina Initial, etc).

If I am using different name, how am I supposed to GetTabByName ? I cannot have Case/If statements for every culture...!

 
New Post
9/23/2014 3:01 PM
 
not able to test this but AFAIR TabController.Instance.GetTabByCulture(tab.TabID, tab.PortalID, locale) will return the localized version of the tab based on the tabid

Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
9/23/2014 4:09 PM
 
Are you using DNN built in language specific pages or a 3rd party solution for localization?

Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
9/24/2014 3:54 AM
 
cathal connolly wrote:
not able to test this but AFAIR TabController.Instance.GetTabByCulture(tab.TabID, tab.PortalID, locale) will return the localized version of the tab based on the tabid

AFAIR is a 3rd party module? So I have to find the TabID by name, and then this method will give me the new tab according to culture?

 

@Sebastian Leupold, yes I am using built-in localisation.

 
New Post
9/24/2014 6:11 AM
 

Ok, I solved it. I used the following method, please tell me if it is the correct approach.

 

        public static DotNetNuke.Entities.Tabs.TabInfo GetTabByLanguage(string tabname, DotNetNuke.Entities.Portals.PortalSettings pset)

        {

            DotNetNuke.Entities.Tabs.TabController tc = new DotNetNuke.Entities.Tabs.TabController();

            return GetTabByLanguage(tc.GetTabByName(tabname, pset.PortalId).TabID, pset);

        }

 

        public static DotNetNuke.Entities.Tabs.TabInfo GetTabByLanguage(int tabid, DotNetNuke.Entities.Portals.PortalSettings pset)

        {

            DotNetNuke.Entities.Tabs.TabController tc = new DotNetNuke.Entities.Tabs.TabController();

            DotNetNuke.Services.Localization.Locale locale = DotNetNuke.Services.Localization.LocaleController.Instance.GetLocale(pset.CultureCode);

            return tc.GetTabByCulture(tabid, pset.PortalId, locale);

        }

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Language and In...Language and In...GetTabByName and CultureGetTabByName and Culture


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out