Developer forum

Forum » Templates » Newsletter preview in archive overview

Newsletter preview in archive overview

Rob Lohmann
Reply
<div class="newsLetterItemsOverview">
    <!--@If Defined(Newsletter:List.NoRows)-->
        <i><!--@Translate(NewsletterArchiveIsEmpty,"Er zijn nog geen nieuwsbrieven aanwezig.", global)--></i>
    <!--@EndIf(Newsletter:List.NoRows)-->
    <ol>
        <!--@LoopStart(List)-->
        <li>
            <div class="subject">
                <a id="newsLetterItemLink" href="<!--@ActionUrl-->&nlID=<!--@ID-->&ShowDetails=1"><!--@Subject--></a>
            </div>
            <div class="date"><!--@SendDate--></div>
            <div class="content"></div> <!--Preview of the newsletter content should be shown here-->
        </li>
        <!--@DwTemplateTags-->
        <!--@LoopEnd(List)-->
    </ol>
</div>
I'm currently busy building an newsletter archive. Is it possible to get an preview of the newslettercontent in the overview? I don't see any default template tags for this. 

This is what I have so far;



Replies

 
Yury Zhukovskiy
Reply

Hi,

DwTemplateTags in Newsletter V3 module doesn’t work properly.

Use please newsletter object properties from API as tags in template.

So for content you can use HTMLBody or TextBody properties, then tags will be <!--@HTMLBody--> and <!--@TextBody-->.

 

Kind Regards

Zhukovskiy Yury

 
Rob Lohmann
Reply
 Hi,

Thanks for your response. <!--@HTMLBody--> gave me the full html body of the newsletter. So also when pages are sent as newsletter i'm getting the full html body, which isn't the desired result. <!--@TextBody--> keeps giving me the same text-line which is "Partner Newsletter Dear Insert Newsletter Here Change subscription: Unsubscribe:" any explanation for what this is? I'm sure this isn't the newsletter content.
 
Yury Zhukovskiy
Reply
This post has been marked as an answer

Hi,

<!--@TextBody--> is used in TXT format emails.

Newsletter object doesn’t contain “Preview” field, so you have to prepare it manually. Unfortunally, NewsletterV3 module doesn’t provide custom fields for newsletter object, template extenders and notification. Then <!--@HTMLBody--> is single variant you can use. You can use Javascript to prepare required content. For example, place <!--@HTMLBody--> to hidden DIV and; read it’s content as text (http://api.jquery.com/text/).

 

Kind Regards

Zhukovskiy Yury

Votes for this answer: 0

 

You must be logged in to post in the forum