two langauge selectors on page result in invalid xhtml
Add two language selectors and you end up with invalid markup.
www.marktold.com/screencast/sf_two_language_selectors.swf
Greetings from Switzerland
Markus
@Telerik
Any luck in repdroducing this?
Markus
@Telerik
Anybody home and trying to reproduce this?
Markus
---------------------------
While you at it.
I give my content placeholder and divs short ID to keep the HTML down. Like t3 and cph_t3
Is it true that a simple language selector trows out all that HTML, or am I doing something wrong?
languageRepeater_horizontal_langHolder could also read lr_h_lh for example. Not everything has to be worded out.
Could sfLanguageItem also be named sfLangItem
Are the ID's even needed for anything in li, a, span?
Someone told me he is trying to squize every bit out. And I somewhere read that google likes text over HTML?
<
div
id
=
"t3"
>
<
div
id
=
"cph_t3_T9302E8D8019"
>
<
div
id
=
"cph_t3_T9302E8D8019_ctl00_ctl00_controlWrapper"
>
<
ul
id
=
"langsWrapper"
class
=
"sflanguagesHorizontalList"
>
<
li
id
=
"cph_t3_T9302E8D8019_ctl00_ctl00_languagesRepeater_horizontal_langHolder_0"
class
=
"sflanguageItem sflang_en"
>
<
a
href
=
"../en/applications/energy-engineering"
id
=
"cph_t3_T9302E8D8019_ctl00_ctl00_languagesRepeater_horizontal_langLink_0"
class
=
"sflanguageLnk"
lang
=
"en"
><
span
id
=
"cph_t3_T9302E8D8019_ctl00_ctl00_languagesRepeater_horizontal_langName_0"
>English</
span
></
a
>
</
li
>
<
li
id
=
"cph_t3_T9302E8D8019_ctl00_ctl00_languagesRepeater_horizontal_langHolder_1"
class
=
"sflanguageItem sflang_fr"
>
<
a
href
=
"../fr/secteurs-d'application/energietechnik"
id
=
"cph_t3_T9302E8D8019_ctl00_ctl00_languagesRepeater_horizontal_langLink_1"
class
=
"sflanguageLnk"
lang
=
"fr"
><
span
id
=
"cph_t3_T9302E8D8019_ctl00_ctl00_languagesRepeater_horizontal_langName_1"
>français</
span
></
a
>
</
li
>
<
li
id
=
"cph_t3_T9302E8D8019_ctl00_ctl00_languagesRepeater_horizontal_langHolder_2"
class
=
"sflanguageItem sflang_it"
>
<
a
href
=
"../it/settori-di-applicazione/energietechnik"
id
=
"cph_t3_T9302E8D8019_ctl00_ctl00_languagesRepeater_horizontal_langLink_2"
class
=
"sflanguageLnk"
lang
=
"it"
><
span
id
=
"cph_t3_T9302E8D8019_ctl00_ctl00_languagesRepeater_horizontal_langName_2"
>italiano</
span
></
a
>
</
li
>
</
ul
>
</
div
>
</
div
>
</
div
>
<
div
id
=
"t3"
>
<
div
>
<
div
>
<
ul
id
=
"langsWrapper"
class
=
"sflanguagesHorizontalList"
>
<
li
class
=
"sflanguageItem sflang_en"
>
<
a
href
=
"../en/applications/energy-engineering"
class
=
"sflanguageLnk"
lang
=
"en"
><
span
>English</
span
></
a
>
</
li
>
<
li
class
=
"sflanguageItem sflang_fr"
>
<
a
href
=
"../fr/secteurs-d'application/energietechnik"
class
=
"sflanguageLnk"
lang
=
"fr"
><
span
>français</
span
></
a
>
</
li
>
<
li
class
=
"sflanguageItem sflang_it"
>
<
a
href
=
"../it/settori-di-applicazione/energietechnik"
class
=
"sflanguageLnk"
lang
=
"it"
><
span
>italiano</
span
></
a
>
</
li
></
ul
>
</
div
>
</
div
>
</
div
>
@Telerik
Anyone?
Markus
Hi Markus,
We were not able to reproduce the error on our local machine. I followed the video step by step and did not end up with the exception.Here is a video of what I did. Please inform me if there is something I am not doing correctly.
If not then this leads me to believe that this issue needs to be resolved on your project.
Regards,
Ivan D. Dimitrov
Telerik
Dear Ivan
Did you read the post title and watch my screencast?
What I am missing from your video is checking for valid XHTML:
www.marktold.com/screencast/sf_two_language_selectors.swf
Markus
You're wasting your time making your Ids small, the "savings" are beyond trivial, especially when you take into account future maintenance on obscure IDs...
Why don't you just set ClientIDMode="Static" on the control and see if it works...usually does (for most things) and you don't get the bloated asp webforms IDs.
Dear Steve
My main concern is the invalid XHTML.
Reducing mark-up was just a side request. And am not trying to make my IDs small. I am trying to make Telerik make my IDs small :-)
And I do still think size matters even more now that we have a lot of smart phone users.
Markus
With compression you will barely save a byte on trimming a couple characters from some IDs...it's such a non issue. Now removing the WEBFORMS prefixing (cph_t3_T9302E8D8019_ctl00_ctl00_languagesRepeater_horizontal_langHolder_0) saves both a measureable amount, and allows easier javascript selectors to be used.
However they can't use ClientIDMode static by default as someone might have a need to use the widget more than once...which is your issue
So in THIS case, it's solved easily by changing the template from
<
ul
id
=
"langsWrapper"
class
=
"sflanguagesHorizontalList"
>
TO
<
ul
id
=
"langsWrapper"
class
=
"sflanguagesHorizontalList"
runat
=
"server"
>
@Ivan
How about it - were you finaly able to reproduce the invalid XHTML markup?
Markus
Hi Markus,
We were able to reproduce the issue. It seems that the ClientID of the language selector does not take the value of inherit even though it is specified in the designer. This results in invalid markup. I have logged this as a bug. You can track the progress as well as vote in order to increase the bug's priority in our PITS. We will do our best to dispose of the issue in our future releases.
Regards,Dear Ivan
Thanks. I love the: to increase the bug's priority comment :-) But for what it's worth I voted for it.
Markus
Dear Ivan
Sorry to say that two language selectors in 6.3 still produce invalid xhtml code.
Markus
Dear Ivan
Sorry to say that two language selectors in 7.1 still produce invalid xhtml code, unless I am mistaken :-(
Another bug that is not fixed after one year. Isn't XHMLT compatiblity high on the list?
2015, Sitefinity 7.2.5310 and this is still happening....
Hello all,
The bug in question has been escalated to our development teams.
Regards,
Ivan D. Dimitrov
Telerik