4

To create a SmartTarget region we need to:

  1. Configure them in smarttarget_conf.xml.
  2. Template the tcdl tag as seen in the documentation, which recommends placing this in a DWT TBB.
<tcdl:region id="sidebar" type="SmartTarget"> 
    <br>Fallback content goes here.</br>
    <br> <tcdl:ComponentPresentation type="Dynamic" componentURI="tcm:6-1072" templateURI="tcm:6-66-32"></tcdl:ComponentPresentation></br>
</tcdl:region>

I want authors to control the text within the tcdl:region tag as well as the Component and Template selection. The use case might be:

  • Author selects a "ST Region" Component that possibly adds a (translatable) heading field
  • A ST Region CT outputs the appropriate tcdl markup
  • Author could otherwise configure this regions by:
    • Moving the location of the ST Region by changing Component Templates
    • Re-ordering the Region as a Component Presentation
    • Possibly change the region's id

The main catch I'm told is we probably need to republish any changes to such configurable regions to make this work in Experience Manager and Session Preview. Alternatively, I could drive ST Regions with Page and/or Template Metadata (similar to configurable XPM regions).

Am I missing any functional or technical "gotchas" with this approach? I've seen a few configurable XPM region setups and want to see if we can easily apply the same with ST regions.

4

Regions and regions

SmartTarget (ST) regions are different from Experience Manager (XPM) regions. They are both a concept have their own markup/tcdl/controls/tags and have a different meaning.

With XPM regions you tell XPM where to allow component presentations (CP) to be added to the page, and how many and what kind of CPs.

With ST regions you instruct ST to query for promotional content and add it to the page in that spot, also XPM will pick up on it and add some nice ST info on the XPM CP borders.

Fallback content

I want authors to control the text within the tcdl:region tag as well as the Component and Template selection

The contents of the TCDL:region tag will be rendered as the fall back content. Everything within the TCDL:region will be rendered in the Fallback content element in the smarttarget:Promotions control/tag. See this SmartTargetTags-2014.aspx gist for an example.

In most implementations you could render CPs in the fallback content, i.e. some CPs added to the page, or component links from some field. XPM does not allow to change the fall back content as you would not see the fall back content in XPM unless you disable all promotions for that region. (that would be a nice switch in XPM, to disable ST to test how all the fall back content works)

Static SmartTarget regions

If you have a region on a page which is designed to be in the same spot in the page layout, i.e. a homepage banner which is always on the top of the home page, you would add a ST region on the page. The page template would render the TCDL:region tag in the same spot every time. For fall back content the editor would add DCPs on the page which are then rendered inside the TCDL:region tag. SmartTarget will only show this fall back content if SmartTarget does not return any promotions, i.e. when no promotions apply for that region, or when the query to the SDL Fredhopper server times out.

Dynamic SmartTarget regions

To let the editor determine where the SmartTarget region should appear, i.e. a "related content" region which can be added anywhere on a page, you could have a system component with a ST region component template to let the user have control over where to add the region to the page.

Experience Manager challenge

I am not sure how this would look like in XPM, I did not try yet. Possibly XPM would not be too happy having a component in a component, since it would render this nested CP-in-CP structure:

  • system component presentation which puts the SmartTarget region on the page
    • SmartTarget region
      • component presentations queried by SmartTarget

Maybe the question was open for multiple interpretation, let me know if I actually answered it.

  • My question is a bit open to interpretation, but this does answer the main "can we template the tcdl" question. Thanks for clarifying the ST region behavior--I'd guess you could set a Footprint or persona that doesn't match any ST triggers to see the defaults, right? And though I've had components within components work in XPM, I also need to test out ST scenarios. The biggest catch I've seen with "embedded" CPs is having them invalidate XPM regions. I guess the next test is seeing if we can drag-and-drop a CP-controlled ST region in XPM. :-) – Alvin Reyes Aug 19 '14 at 12:30
  • Update on regions-within-regions: I've been able to get nested regions to show up in XPM breadcrumb, even ST regions within XPM regions, though the breadcrumb seems like it won't show a region within a Component and borders weren't playing nicely. I'll leave this as a "it might work" scenario. – Alvin Reyes Aug 29 '14 at 22:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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