Language breaks custom field

Posted by Community Admin on 04-Aug-2018 16:18

Language breaks custom field

All Replies

Posted by Community Admin on 29-Oct-2013 00:00

Hey,
i created a custom field in a clean project for selecting multiple images and displaying them in a image gallery (with a javascript, that shoould only be rendered into the site in the frontend, not in the backend).  In my clean project it was working, in my actual website it was not. And broke the content edit view (look at the screenshot).  This was because the javascript of my conditional template (in the ascx) was rendered into the backend. This should not happen because the javascript is defined under the displaymode "read":

<sf:ConditionalTemplate Left="DisplayMode" Operator="Equal" Right="Read" runat="server">

   I realized that this happens when you have your website support multiple languages. It then renders the field two times. The first time as expected. And the second time in read mode under

<div id="contentViewEditDialog_ctl00_ctl00_contentView_newsBackendEdit_ctl00_ctl00_translationWrapper" class="sfTranslateFromWrp">

Which in my case destroys the layout. Can i somehow prevent the second render?

Aswell i had another small bug, while editing a page. If you got a layout element with 2 columns (for example 50% 50%) and try to set margins, the left margin of the second column will not apply. And the margin is also deleted, after reopening the settings.

Thx for helping,
Johanna



Posted by Community Admin on 01-Nov-2013 00:00

Hi Johanna,

Thank you for using our products.

 The script behavior you notice can be dealt with fairly easily. Please direct your attention to this blog post. The example there uses the page's PreRender event in order to determine whether the page is in Design mode and in the backend and does not execute your scripts then. Provided the scripts do not run while in page editor you will not notice the problems you described. Please make sure that you clear your browser cache after you apply the fix so that Sitefinity can load the scripts from the server, not the cache.

As for the margins - this is a known bug in Sitefinity. it has to do with the fact that Sitefinity layout controls accept their margin values as inline and therefore are very hard to override. I have increased the bug's priority. You can track its progress as well as vote for it in order to increase its priority yourself in our PITS.

I hope this information helps. We apologize for any inconvenience caused.

Regards,
Ivan D. Dimitrov
Telerik
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

This thread is closed