Skip to content

Mailmerge Markdown Questions and Guide

williamhoos edited this page Oct 18, 2021 · 31 revisions

Guide to a template of Markdown for card view and study page:

Islands:

Islands are a block of other react code that can be inserted.

Currently Support Islands for two page types, Study and Search

Study

  • <Workflow></Workflow> (to show a specific workflow, use the name=“WF_ALS1” for example (<Workflow name=“WF_ALS1”></Workflow>)

  • <Facility></Facility>

  • <Wikipage></Wikipage> - replaced by island_config for a TEXT_EDITOR of clinwiki_text -prod id 825

  • <Navigation></Navigation>

  • <Back></Back>

  • <Reactions></Reactions>

  • <Reviews></Reviews>

  • <Expander header=“Value to display in Expander, can include {{field}}” collapsed=true>[any other content to contain in expander]</Expander>

  • <EditsHistory></EditsHistory> shows the history of wiki edits

  • prev/next sample

<a class=“btn prev-btn” href={{previousStudy}}?hash={{querystring hash}}&pv={{querystring pageViewUrl}}><i class=“fa fa-arrow-circle-left fa-2x”>&nbsp;Previous </a> <a class=“btn next-btn” href={{nextStudy}}?hash={{querystring hash}}&pv={{querystring pageViewUrl}}><i class=“fa fa-arrow-circle-right fa-2x”>&nbsp;Next </a>

  • <agg id=“0”></agg> *

  • <searchwithin></searchwithin> - Search bar

  • <savesearch></savesearch> - Save Search/ Subscribe button

  • <csv></csv> - Download CSV button

  • <resultsort></resultsort> - result sort drop down

  • <resultloader></resultloader> - loader component indicates results loading

*The agg islands are created and configured under the AggIslands tab in the User Menu. (Note it is an admin feature)

Other:

Querystring

  • {{querystring ALL}} will insert the entire current querystring

  • {{querystring <name>}} will insert the value of the querystring parameter (ie for a querystring “/study/NCTID?sv=default&hash=kdhsykx” {{querystring hash}} will insert value “kdhsykx” in mailmerge )

Current supported values are: “hash”, “siteViewUrl”, “pageViewUrl”

Open Questions:

  • For “default” table style, can we set it to some styles and then we can use the markdown table and inherit the site’s theme and only use html if we want something different?

  • Is there a way to set a row in a table to be a link with markdown or html?

  • Curious why the briefSummary field, when inserted as a H2 or H3 ends up as block text: - likely inserting variable mailmerge before interpreting markdown

  • tables don’t seem to honor spacing, do we need to use &nbsp?

Functions implemented:

  • Text

    • {{$LEFT field count}} ex {{$Left briefTitle 9}} “Long Term Follow-up” => “Long Term”

    • {{$RIGHT field count}} ex {{$RIGHT briefTitle 9}} “Long Term Follow-up” => “Follow-up”

    • {{$TRUNCATE field count}} ex {{$Left briefTitle 10}} “Long Term Follow-up” => “Long Term…” (where elispse contains “Follow-up” )

    • {{$FindAndReplace ‘value to find’ ‘value to replace’ field }} ex {{$FindAndReplace ‘Recruiting’ ‘✅ Recruiting’ overallStatus }} - note, single quotes OR double quotes are allowed for the strings alt multi-example: {{$FindAndReplace ‘completed | available | suspend| terminated’ ‘&#9989 Completed | &#9989 Available | Suspend | &#10060 Terminated’ overallStatus}}

Functions needed:

  • Is there a toolkit of text manipulation functions that we could adopt in full?

  • Date - convert date formats to display type, month/year, date between

  • Dependencies ((find-and-replace-values)) - ideally allow specifying an array and documenting a processing order (ie if replacing “recruiting” and “not yet recruiting” - confirm order/options to specify to get correct behavior

  • ((if)) only display field and related text if value is equal to something or blank/null/missing (ie if we want to show “(Completion Date: 1/1/2020)” - function should allow specifying that it should only show this block of content if the value of {{completiondate}} is present.

  • Relative Reference and pointing to other parts of the site - how to link to the intervention page or to a search result and add a value to the search criteria (but possibly maintain values in the has from the url)

  • Creating link from a whole row instead of link to a text within a row

Clone this wiki locally