Leo Vildosola


I have written a plugin that extends SmartContentSource. I persist the ISmartContent.Layout.Alignment property and later reload it to be my default value. When I create a new instance by selecting Insert Plugin Name from the side panel and the alignment is either Alignment.Left or Alignment.Right, the smart content instance does not layout correctly. I have to reset it to either of these values via the UI to force the correct layout. I am trying to set this property in the CreateContent method. Any ideas what may be causing this





Re: SmartContentSource plugin and preset Alignment

Scott


Shot in the dark, try setting it in the GeneratePublishHtml method instead...





Re: SmartContentSource plugin and preset Alignment

Leo Vildosola

Thanks for the suggestion. Unfotunately, this did not work either. In fact, I tried it in GetEditorHtml since I use different rendering for the editor vs. what is published.

To provide more detail, what is happening is that the bounding rectangle of the smart content draws all the way to the right taking the entire width of the editor area when I set the ISmartContent.Layout.Alignment to Alignment.Right. The object is set not to be resizable.







Re: SmartContentSource plugin and preset Alignment

OmegaMan

Not the answer you a looking for but check out this thread New SDK Version which may fix what you are seeing once the next beta version is released.

PS Love your code snippet plugin; the use of Winforms is very clean and I have had no problems using it.





Re: SmartContentSource plugin and preset Alignment

Leo Vildosola

Thanks for the update on the new SDK. I can't wait for the new Beta to come out.

I'm glad to hear you enjoy using the plugin. I will be making changes to it to allow editing already formatted code. I'll be doing this when I get a chance. I will probably wait until the next Beta release of WLW to do it.