Technical support This forum is closed.
Version 1.x > Technical support > Product Page template and EditableRegion View modes: 
User avatar
Member
Member
Chameane - 11/28/2005 1:16:48 PM
   
Product Page template and EditableRegion
Hi,

I'm trying to make a product's page like this:

_____________________________________________________
|___________
|Familly Logo | Header
|___________|
|
|____________________________________________________
|
| Datalist wich shows Product's Information
|
|____________________________________________________
|
| Foot
|____________________________________________________

Where:
-Many Products can share a Familly Logo
-The name of the familly logo is not in rapport with the product's name or other characteristics

How can I do that? I've first think about editable regions, but I cannot configure them for the pages that shown cms.product.default transformation... I can write something like this in the code-behind:

CMSEditableRegion1.Value="<img height='116' alt='' src='/CorporateSite/GetFile.aspx?aliaspath=/images/product_familly_logo_gif' width='175' />";
But I cannot know before the name that the user's will give to the image, specially 'cause it also depends on the product that the CMSDatalist is shown.
I find the shame problem if I use a CMSViewer...
I've thought to include a champ in the product's template with the name of the familly logo, but I don't know how to retrievethis champ in the code-behind to build the string.
If anyone can help me (or has a simplest way to do it...)
I'd be very grateful

User avatar
Guest
admin - 11/29/2005 1:28:44 PM
   
Re: Product Page template and EditableRegion
Hello,

if the image depends on the product, you could possibly add the logo image selection field to the product document type. Then, you would be able to select any logo for the product.

Here's how you will display it then:
1) Add a literal control to the place where the logo should be displayed.
2) Add a code like this in your code behind:

if (Functions.GetDocumentType().ToLower() == "cms.product")
{
// product was selected
Literal1.Text = "<img height='116' alt='' src='/CorporateSite/GetFile.aspx?filepath="+ (string) Functions.GetCurrentDocument().GetValue("LogoField") +"' width='175' />";
}

Please let me know if this works for you or if you need any additional details or some alternavite solution.

Best Regards,

User avatar
Member
Member
Chameane - 11/29/2005 3:26:58 PM
   
Re: Product Page template and EditableRegion
Yes,

It works fine!!!
I've just found another (much complicated solution)
I also add the logo to the product description and in the code behind I make a dataset with your "selectnodesbypath" query to finally retrieve the right column...
But your solution it's much better!
Thanks a lot