Language breaks custom field
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"
>
<
div
id
=
"contentViewEditDialog_ctl00_ctl00_contentView_newsBackendEdit_ctl00_ctl00_translationWrapper"
class
=
"sfTranslateFromWrp"
>
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.