Hiding fields to reference in other areas?

Store UI, layout, design, look and feel; Discussion on the customer facing pages of your online store. Cascading Style Sheets, Themes, Scriptlets, NVelocity and the components in the ConLib directory.
Post Reply
RKS_213
Lieutenant (LT)
Lieutenant (LT)
Posts: 69
Joined: Mon Dec 26, 2011 2:48 pm

Hiding fields to reference in other areas?

Post by RKS_213 » Fri Dec 30, 2011 4:42 pm

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.

User avatar
david-ebt
Captain (CAPT)
Captain (CAPT)
Posts: 253
Joined: Fri Dec 31, 2010 10:12 am

Re: Hiding fields to reference in other areas?

Post by david-ebt » Fri Dec 30, 2011 7:11 pm

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:

Code: Select all

<asp:LinkButton ID="More" runat="server" Text="more details" OnClick="More_Click" EnableViewState="false"></asp:LinkButton>
In the ascx.cs file, this is the code that hides or displays that LinkButton depending on whether the product has an extended description:

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;
}
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?
David
http://www.ecombuildertoday.com
Enhanced Reporting for AbleCommerce
Image

RKS_213
Lieutenant (LT)
Lieutenant (LT)
Posts: 69
Joined: Mon Dec 26, 2011 2:48 pm

Re: Hiding fields to reference in other areas?

Post by RKS_213 » Mon Jan 02, 2012 9:51 am

Yeah, it does make sense. Thanks. I'm going to be trying this today so I'll report back if it works.

RKS_213
Lieutenant (LT)
Lieutenant (LT)
Posts: 69
Joined: Mon Dec 26, 2011 2:48 pm

Re: Hiding fields to reference in other areas?

Post by RKS_213 » Mon Jan 02, 2012 12:16 pm

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.

Post Reply