diff --git a/bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/Base_getTemplateProxyParameter.py b/bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/Base_getTemplateProxyParameter.py
index 31439c4d6cd6b80f24745239603f61bd403ac91d..bd82b85d46e3c7d66ec15be56bcb679ea9d7c46b 100644
--- a/bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/Base_getTemplateProxyParameter.py
+++ b/bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/Base_getTemplateProxyParameter.py
@@ -326,6 +326,12 @@ if pass_parameter is not None and pass_source_data is not None:
   # XXX custom?
   if pass_parameter == "theme":
     theme = None
+    tmp = context
+    #check if web page is inside web site or web section
+    while portal_type == 'Web Page':
+      tmp = tmp.aq_parent
+      portal_type = tmp.getPortalType()
+      
     if portal_type == "Web Site" or portal_type == "Web Section":
       pass_flag_site = True
     product_candidate_list = callSelf("product", pass_source_data, pass_flag_site)