kentico_zdenekc
-
8/21/2008 12:12:24 PM
RE:Newsletter webpart
Hi Gary,
the desired functionality could be achieved, although it's not completely out-of-the-box.
Regarding "Newsletter Subscription" webpart, you could use the setting 'Display to roles' in webpart's properties. In CMS Desk in design mode, you can create three webparts. For these webparts, you will set 'display to roles' to "" (=all), "MemberA" or "MemberB" as you want to. Also, you will need to set one predefined newsletter accordingly to the role in each webpart. Then for public users, only first one appear, and for membersA/B, appear the public and one of the membershipA/B newsletters. The disadvantage is, that if two newsletters will be displayed, there won't be checkboxes, but two webparts (You will need to distinguish by some label between them).
As for the "My Subscriptions" webpart, you could clone the default webpart in SiteManager, also clone the file with the ascx control used by this webpart (MySubscriptions.ascx.cs - it's the file inside 'MySubscriptionsWebpart_files' folder in '~\CMSWebParts\Newsletters'), and then modify the code behind of that control (e.g. MySubscriptions-clone.ascx.cs), especially lines 194--207, where the newsletters (the names) are being added as items to the list. Please find more details about obtaining current user name in API programming section of our Developers Guide, you could also get inspired in the code you will have to modify. Then you will need to correct the link to that control in the cloned webpart's .ascx file, it's the value in the Register Src="..." parameter.
Hope this will help you.
Best Regards, Zdenek Cetkovsky
|