Quantcast
Channel: DevNet Questions
Viewing all articles
Browse latest Browse all 8901

Kentico 9 cms:cmsTextBox placeholder localization

$
0
0
I've duplicated the search box webpart so i can make changes. I'm trying to add a localization string to the placeholder attribute.This isn't working:@cms:CMSTextBox ID="txtWord" runat="server" EnableViewState="false" MaxLength="1000" ProcessMacroSecurity="false" placeholder="@%= CMS.Helpers.ResHelper.GetString("kff.Search--PlaceHolderCopy")%@" /@ nor does this:@cms:CMSTextBox ID="txtWord" runat="server" EnableViewState="false" MaxLength="1000" ProcessMacroSecurity="false" placeholder='@%= CMS.Helpers.ResHelper.GetString("kff.Search--PlaceHolderCopy")%@' /@ I have a JS Snippet that does work, but i'm hoping to avoid copy in JS files. var $searchField = $('.searchTextbox'); if ($('body').hasClass('ENCA')) { // search field placeholder copy $searchField.attr('placeholder', 'Search For Stuff'); } else { $searchField.attr('placeholder', 'Recherche'); }Can I add the localization string to the server tag, or should it be done in the code behind. I'm not sure the best location in the code behind for this either, I can't see a Page_Load block.

Viewing all articles
Browse latest Browse all 8901

Trending Articles