Portal Engine
Version 3.x > Portal Engine > Newsletter webpart View modes: 
User avatar
Guest
gary.chan-e-crusade - 8/21/2008 6:36:23 AM
   
Newsletter webpart
Hi

I have question regarding newsletter webparts, please give advise. Kindly correct me if I am made any incorrect assumption here.

I have three newsletters
- 1. Public newsletter
- 2. Membership A newsletter
- 3. Membership B newsletter

"My Subscriptions" webpart
- This webpart requires visitor to log on first.
- Once logged on, the visitor (which means s/he is a member) has a list of all 3 newsletter and be able to subscribe and unsubscribe any of these.
- How can I show only newsletter 1 and 2 or 1 and 3 but not all 3? Setting the display to roles will either show all or hide all since that property applies to the webpart
- For example newsletter B should not be an option non visible to anyone whos membership is of type A


"Newsletter Subscription" webpart
- This webpart does not require visitor to log on, open to all, and I assume its built for that purpose.
- Similar to the previous problem. Public can access this page and subscribe the public newsletter, which is fine, but how can we hide the other two member newsletters from the list?

Thanks and Regards,
GC

User avatar
Member
Member
gary.chan-e-crusade - 8/21/2008 6:45:25 AM
   
RE:Newsletter webpart
Sorry folks, want to update something on "Newsletter Subscription" webpart

I think this webpart allows either show ALL or only ONE pre-defined newsletter, but nothing in between

User avatar
Guest
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