Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > Getting url from Editable Image View modes: 
User avatar
Member
Member
jason-synapse - 5/22/2012 11:28:54 AM
   
Getting url from Editable Image
I want to use Editable Image to place an image on every page.

It would be nice if I could just edit the transformation, but that does not seem to be available for this webpart.

I can't use it as is, because I need it to be the background of a layer, so what I would like to do is insert something on the page such as:

<style>
.myclass { background-image: url(/path/to/editable/image.jpg);
</style>



I was able to do something similar using the method described here:
http://devnet.kentico.com/Blogs/Neil-Powers/January-2012/Using-Template-Inheritance-and-Image-Attachments-t.aspx

The problem with that method is that it uses a different url for the attachment, even if its the same image, so it reloads every time.

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 5/23/2012 3:16:18 AM
   
RE:Getting url from Editable Image
Hi,

would you like to create a banner or you would like to simply display one image in the background?

You can simply insert static html code web part to your master page and create a div for which you will apply the style.

Then the image itself can be inserted directly in the project folder, under /App_Themes/<your_stylesheet_codename>/image.jpg.

Then you can link the direct path which will not be changed.

Or you need allow editors to change image directly in the UI?

Thank you for clarification.

Best regards,
Ivana Tomanickova

User avatar
Member
Member
jason-synapse - 5/23/2012 8:49:00 AM
   
RE:Getting url from Editable Image
I need the editors to be able to edit it directly

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 5/28/2012 7:48:43 AM
   
RE:Getting url from Editable Image
Hi,

this will require a customization.

You can use head html web part and path to image replace with a custom macro.

In your custom macro you can read the content of editable image web part using PageInfo class.

PageInfo pi = PageInfoProvider.GetPageInfo("CorporateSite","/","en-us","",false,ConnectionHelper.ContextConnection);
PageTemplateInfo pt = pi.PageTemplateInfo;
WebPartZoneInstance wpzi = pt.GetZone("zoneLogo");

But maybe the easiest solution would be to modify head html web part to ensure requested functionality.

Best regards,
Ivana Tomanickova