Jump to content

Inline Graphic with a Switch Rule


AngelBenitez

Recommended Posts

Hello,

Can someone walkthrough me through including an inline graphic but also create a rule within that inline graphic to do the following:

If the value of a field is yes, then show the graphic; however, if the value of the graphic is no, then don't show the graphic.

 

If someone can help me, I would greatly appreciate it.

Link to comment
Share on other sites

if (Trim(ToLower(Field("YourFieldName"))) != "yes")
    return "";
// else something that returns a graphic, such as:
return Resource("ResourceName");
// or:
return CreateResource("somefile.jpg", "graphic");
// or:
return '<graphic file="somefile.jpg">';

 

Link to comment
Share on other sites

2 hours ago, AngelBenitez said:

Hello @Dan Korn; thank you for your response. I'm unsure if you are familiar with using MarcomCentral, but which one of these rules would I use to pull in the image based on an image collection? If so, do I need to take any additional steps to achieve this outcome?

A graphic in an image collection in MarcomPortal is referenced by the graphic's file name.  So you would need this variation:

 

if (Trim(ToLower(Field("YourFieldName"))) != "yes")
    return "";
// else something that returns a graphic, such as:
return CreateResource("somefile.jpg", "graphic");

Note that since this is going to be an inline graphic, that is, a graphic that flows inline with text, you need to do this in a Text rule.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...