ASPX templates
Version 3.x > ASPX templates > Add webpart to transformation View modes: 
User avatar
Certified Developer 8
Certified Developer 8
bryan-bit-wizards - 10/28/2008 9:29:19 AM
   
Add webpart to transformation
Is it possible to add a webpart in a transformation? I would like to dynamically add the LightBoxGallery webpart using a transformation for a query.

Is this possible?

User avatar
Certified Developer 8
Certified Developer 8
bryan-bit-wizards - 10/28/2008 11:08:56 AM
   
RE:Add webpart to transformation
I created a user control which uses the LightBoxGallery.ascx control. I have added an Inline Control to system. I can include it in my transformation using:

Ex: %%control:MYLightBoxGallery%%

I need to pass it a value for its parameter. I can do this with a static path:

Ex: %%control:MYLightBoxGallery?Images/MyFolder/%%

However, I need to pass the parameter dynamically in the transformation. I have tried the following, however it is just passing the Eval code text as a string.

%%control:MYLightBoxGallery?Eval("ImageGalleryPath") %%

I need to pass the value of Eval("ImageGalleryPath") as the parameter. Is this possible?

User avatar
Certified Developer 8
Certified Developer 8
bryan-bit-wizards - 10/28/2008 11:19:43 AM
   
RE:Add webpart to transformation
The following code in my transformation worked:

%%control:MYLightBoxGallery?<%#Eval("ImageGalleryPath")%>%%

The issue was that the "ImageGalleryPath" contained the following:

"/images/gallery/%"

The "%" was causing an issue in the parameter that was passed. I removed it from the bizform field and modified the inline control to append this to the parameter:

this.LightboxImageGallery.Path = this.Parameter + "%";

Hope this helps anyone with the same issue.

User avatar
Member
Member
foobar17554 - 6/30/2010 9:03:00 AM
   
RE:Add webpart to transformation
Hi Bryan,

Was there supposed to be a code sample in your first post in this thread? If so it's missing. Can you re-post and add it please? That would be most helpful.

Thanks,
CW

User avatar
Member
Member
foobar17554 - 6/30/2010 9:03:30 AM
   
RE:Add webpart to transformation
Actually, it was the second post.

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 7/1/2010 2:53:10 AM
   
RE:Add webpart to transformation
Hi,

The code used in the examples that was inserted was resolved in the text area :-)

You can see it below - I added extra spaces using underscore sign ("_"), so it won't be resolved:

2nd post:
%_%_control:MYLightBoxGallery_%_%
%_%_control:MYLightBoxGallery?Images/MyFolder/_%_%

3rd post:
%_%_control:MYLightBoxGallery?<%_#Eval("ImageGalleryPath")%_>_%_%

Best regards,
Juraj Ondrus

User avatar
Member
Member
amirelshater999-hotmail - 6/20/2013 9:39:46 AM
   
RE:Add webpart to transformation
Dear,

Can i pass 2 or more parameter to the inline control in the transformation

thank you
Best regards,
Amir Elshater

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 6/20/2013 10:00:18 PM
   
RE:Add webpart to transformation
Hi,

What version of Kentico do you use? This forum is for version 3.x. In never versions the inline controls were changed. How exactly and where are you using the inline control?

Best regards,
Juraj Ondrus

User avatar
Member
Member
Amir Elshater - 6/21/2013 11:19:55 AM
   
RE:Add webpart to transformation
Dear,

I am using v. 7

I have hotel document type and us it in list web part
In the transformation i preview hotel data like name , desc. And offer
Also contain link to open popup reg. Form (ascx)
so i use inline control in the transformation
%%controlName?<%# Eval("ID") %>%%
And code behiend

Int ID = this.parameter

So i need to to pass 2 parameters to the ascx
In transformation and code behiend

Best regards

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 6/23/2013 1:08:31 AM
   
RE:Add webpart to transformation
Hi,

I think that the best way would be to create a custom transformation function. This function will work with the two parameter and your logic. Or ,it will output two parameters as you need.
So, you will be using it like now:
%%controlName?<%# CustomFunction("your paremeter1", "parameter2")%>%%


Best regards,
Juraj Ondrus