Forum Index

No notifications
Notifications

Favorites

No favorites found
Ask the community Need help to achieve something? - Ask the Community
Join the Conversation > Ask the community > Content Block Mapped to Variable View modes: 
User avatar
KnowledgeKube Staff
KnowledgeKube Staff
matt.pitman - 20/02/2017 14:43:15
   
RE:Content Block Mapped to Variable

Hi Din

I created a variable named MyVar3 and gave it the following value:

<div>
    <div><img src='http://pix.iemoji.com/images/emoji/apple/ios-9/256/white-smiling-face.png' /></div>
    <div><img src='http://pix.iemoji.com/images/emoji/apple/ios-9/256/upside-down-face.png' /></div>
</div>

I then created a content block with the following question text:

<%# KEYWORD(MyVar3) %>

It resulted in a page containing the two images shown in the attached file (dynamic-divs.png).

If this is how you're doing it and you're not getting the correct result, let me know so I can contact you directly and take a look at your implementation.

Kind regards.

Post attachments:

User avatar
Advanced member
Advanced member
Din TIR - 20/02/2017 06:28:57
   
RE:Content Block Mapped to Variable

Hi Matt,

I am trying to display the dynamic HTML content i generate to the variable. Maybe the previous example was not good enough.

Here another example, to display thumbnails getting from data source like attached.

First I create a variable called, VarThumbnailsHTML, then inside a Form Load Expression I put the expression below.

VarThumbnailsHTML:= "<div class='profile-container'>"
ForEachDataSourceRow("GenerateAndAttachHTMLForEachThumbnail","DataSourceName","FilterName","True");
VarThumbnailsHTML:= VarThumbnailsHTML & "<div class='clear'></div>";

I also create a action called, GenerateAndAttachHTMLForEachThumbnail, and enter the expression below.

VarLocalImageSrc:= "data:image/jpeg" & VarSemiColon & "base64, " & ImageBinaryAlias;
VarThumbnailsHTML:= VarThumbnailsHTML & "<div class='profile-image-wrapper'><img src='" & VarLocalImageSrc & "' /></div>";

With the above 2 expressions, the variable VarThumbnailsHTML should generate HTML below:

<div class='profile-container'>
    <div class='profile-image-wrapper'><img src='data:image/jpeg;base64, ImageBinaryAliasValue1' /></div>
    <div class='profile-image-wrapper'><img src='data:image/jpeg;base64, ImageBinaryAliasValue2' /></div>
    <div class='profile-image-wrapper'><img src='data:image/jpeg;base64, ImageBinaryAliasValue3' /></div>
<div class='clear'></div>

The issue is placing the variable VarThumbnailsHTML value into the Content Block.

Post attachments:

User avatar
KnowledgeKube Staff
KnowledgeKube Staff
matt.pitman - 17/02/2017 11:01:58
   
RE:Content Block Mapped to Variable

If you'd like to learn more about markup assets and several other aspects of the Content Delivery interface, take a look at the following training module:

Content Delivery in KnowledgeKube

Kind regards.


1 2 3 4
RSS Feed