2

Dears,

I have just started with Smart Target and going through docs. I am confused by below 2 points. If you can please help me understand, that will be helpful for me.

Point 1: The docs say to add the relevant Smart Target Building Blocks to Page Template. I added TBBs: "Add To Smart Target", "Add Smart Target Query", "Add Promotions" etc...

So, does adding these TBBs is enough to generate the required Code to display promotional items ? What I mean is that adding smart target TBBs generate below code in the ASPX page ?

<tcdl:promotions maxItems="20" region="Sidebar">
   <tcdl:itemTemplate>
        <br>
           <b>Title:</b><asp:Label Text=”##Title##” runat="server"/>
           <b>Slogan:</b><asp:Label Text=”##Slogan##” runat="server"/>
        </br>
        <tcdl:promotionalItems>
             <tcdl:itemTemplate> 
                  <tcdl:ComponentPresentation componentURI='##ComponentUri##' TemplateURI='##TemplateUri##' Type='Dynamic'/>
             /tcdl:itemTemplate>
        </tcdl:promotionalItems>
   </tcdl:itemTemplate>
   <tcdl:fallbackContent>... 
   </tcdl:fallbackContent>
</tcdl:promotions>

I was referring thos doc URl: https://docs.sdl.com/792480/164695/sdl-smarttarget-2014/displaying-promotion-title-and-slogan

  • How do we customize the HTML which is inside the <tcdl:itemTemplate> ?
  • Do I need to edit manually the HTML and those TCDL tags / write the TCDL tags myself in ASPX page or the Smart Target TBBs do it automatically ?
  • If I have to write the TCDL tags myself in ASPX page, what is the purpose of Smart Target TBBs ?

2 Answers 2

3

Yeah, SmartTarget has that effect on people. You think you don't have a clue what is going on for about 3 months, then it all fits together. So, to answer your question:

So, does adding these TBBs is enough to generate the required Code to display promotional items ? What I mean is that adding smart target TBBs generate below code in the ASPX page ?

The answer is no. Adding "Add to SmartTarget" will push these items to Indexing engine (in your case depending on Tridion version to Fredhopper or Elastiqsearch). So, you still need to generate these tags on a page. These tags will execute if you have XO module on the presentation side installed, but you still need to generate them.

The first option is to generate them on the templating side. If you use old dwt templating, you can just generate them in your page DWTs. If you use DXA, you have to generate them again.

Second option is to just hardcode them in page source. They can still work.

And to keep things a bit easier, please read this blog

4
  • When you say: "If you use old dwt templating, you can just generate them in your page DWTs", do you mean adding only the TBBs or you mean adding the TCDL tags itself ? Also, I have added TBBs in addition to "Add To Smart Target" TBB. So it should generate the required TCDL tags such as: tcdl:promotions in ASPX page on publish ? Commented Aug 24, 2020 at 6:56
  • You need to type them in dwt. Like any other html tag. Thats the problem. All the other tcdl tags are generated by some block, but these you must write. Hahahahha
    – Marko Milic
    Commented Aug 24, 2020 at 6:57
  • That's not entirely true, Marko. You need to have at least one tcdl:region tag in your DWT, but the TBBs will generate all of the relevant tags inside of that (like tcdl:query, tcdl:promotions, etc.) Commented Feb 4, 2021 at 14:50
  • Yeah, you are right
    – Marko Milic
    Commented Feb 4, 2021 at 15:00
0

The idea is that you don't edit the itemTemplate markup directly (although you technically can), but rather that it is all controlled by the dynamic Component Presentations that are returned from the query.

(Also the "Add to SmartTarget" TBB is used in the Component Template of the dynamic CPs that you wish to return from the queries -- not in the Page Template)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.