Template Resources
So using the backend template editor, has the syntax to include a resource changed?
This is what's defined in the template
<
sf:FieldListView
ID
=
"Phone"
runat
=
"server"
Text="<%$ Resources:EventsResources, ContactPhone %> 0" Properties="ContactPhone, ContactCell"
WrapperTagName="li" WrapperTagCssClass="cme-event-single-details-phone"
/>
Hello Steve,
It's because of the 0 you have inserted, as it places the string text and messes up parsing the resources text, actually the default syntax is:
<
sf:FieldListView
ID
=
"Phone"
runat
=
"server"
Text="<%$ Resources:EventsResources, ContactPhone %>" Properties="ContactPhone, ContactCell"
WrapperTagName="li"
/>
Well in 99% of the backend editor cases I'm just modifying existing templates, not using the right-hand snippits to make something from scratch :)
So the whole 0 syntax was in the template already...
I'll try this, thx
Hey Boyan,
Here's an example:
The News list templates defines the content like this
<
sf:FieldListView
ID
=
"NewsContent"
runat
=
"server"
Text
=
"0"
Properties
=
"Content"
WrapperTagName
=
"div"
WrapperTagCssClass
=
"sfnewsContent"
/>
<
sitefinity:HtmlField
runat
=
"server"
DisplayMode
=
"Read"
Value='<%# Eval("Content")%>' />
Hi Steve,
Yes, that's true, however both will render the desired content. You can always refer to the default templates when creating/modifying a new one, as well if you prefer sticking to the default implementation. Have you tried the solution from my initial reply, as you correctly pointed out the 0 is automatically added by the control. Alternatively, you can get it with Eval like this:
<
sitefinity:TextField
runat
=
"server"
DisplayMode
=
"Read"
Value='<%# Eval("ContactPhone")%>' />
Both do render the desired content...but they also don't ;)
Like the other issue I mentioned...all of these controls still render extra hidden markup to my pages
So this is what it wants me to use
<
sitefinity:TextFieldrunat
=
"server"
DisplayMode
=
"Read"
Value='<%# Eval("ContactPhone")%>' />
<
asp:Label
runat
=
"server"
Text='<%# Eval("ContactPhone")%>' Visible='<%# (Eval("ContactPhone") == null) ? "False" : "True" %>' />