Developer forum

Forum » Templates » Disabled Language

Disabled Language

Thomas Schroll
Reply

Hi

I am looping through all languages on a top menu. One of the languages are disabled in the backend, but still show in my frontend menu.

Is there a way to not show disabled languages?

Regards Thomas

 


Replies

 
Mikkel Ricky
Reply

How are you looping through the languages? Please post (part of) your template.

Best regards,
Mikkel

 

 

 
Thomas Schroll
Reply

Hi Mikkel

I am using one the solution set templates:

foreach(var language in GetLoop("Languages")) {
	string culture = language.GetString("Culture");
	string active = "";
	if (Dynamicweb.Input.FormatBoolean(language.GetValue("IsCurrent"))) { active = " class=active ";}
	string firstPage = language.GetString("FirstPageID");
	<li class="flags @culture.Substring(3).ToLower()">
            <a href="/Default.aspx?ID=@firstPage"@{@active}hreflang="@culture.Substring(0, 2)">@language.GetString("Name")</a>
        </li>
}

The only available fields are:

  • Name
  • Culture
  • PrimaryDomain ID
  • FirstPageID
  • FirstPageName
  • IsCurrent
  • IsMaster
  • Languages.LoopCounter
  • Languages.LoopMod2
  • Languages.LoopMod3
  • Languages.LoopMod4
  • Languages.LoopMod5
  • parentLoopIndex

Regards Thomas

 

 
Mikkel Ricky
Reply

It's a bug and I've just committed a fix.

Thanks for reporting this.

 

 
Thomas Schroll
Reply

Thanks for looking into it :)

Regards Thomas

 

 

You must be logged in to post in the forum