Is there any documentation on how to hide specific data from products so you can reference them later. For example, if I fill in the "More Details" in the product information, it displays under the "Description" on the page. How would I hide that when I'm shoing the Description like normal and how would I reference just that information in another area?
Thanks.
Hiding fields to reference in other areas?
Re: Hiding fields to reference in other areas?
Take a look at the Conlib\ProductDescription.ascx and .cs file.
In the ascx file this is the line that displays the More Details link:
In the ascx.cs file, this is the code that hides or displays that LinkButton depending on whether the product has an extended description:
You could remove or disable the references to the More/Less buttons in this file and then create a new ConLib control that just dealt with the extended description field.
Does that make sense?
In the ascx file this is the line that displays the More Details link:
Code: Select all
<asp:LinkButton ID="More" runat="server" Text="more details" OnClick="More_Click" EnableViewState="false"></asp:LinkButton>
Code: Select all
bool hasMoreInfo = !string.IsNullOrEmpty(_Product.ExtendedDescription);
if (this.ShowMore && hasMoreInfo)
{
phCaption.Text = MoreDetailCaption;
phDescription.Text = _Product.ExtendedDescription;
More.Visible = false;
Less.Visible = true;
}
else
{
phCaption.Text = DescriptionCaption;
phDescription.Text = _Product.Description;
More.Visible = hasMoreInfo;
Less.Visible = false;
}
Does that make sense?
Re: Hiding fields to reference in other areas?
Yeah, it does make sense. Thanks. I'm going to be trying this today so I'll report back if it works.
Re: Hiding fields to reference in other areas?
It took some hacking and my code looks horrendous but it works. Thanks for the tip. I'll go back and clean it up once this initial demo deadline is up. Right now it still has the bool that returns true no matter what so I will have to take care of that when I have the time.
Thanks again.
Thanks again.