Overview

 

A request was made to try and create a link to an embedded app view, from a piece of content created by the Forms app.  Well, yes, it turns out that this can actually be done...  I am even a little surprised myself, but it can in fact happen and here's how.  This can be done with no change to the app itself, and works as-is, assuming you are on Jive 6+.

 

How To

 

1.  Get a reference link from the app you want to link to

 

  • Create a new piece of content, in which you can utilize the !app functionality
  • From the RTE, perform the !app from the app and get the link into the body
  • Switch the RTE to the HTML view
  • Look for your newly rendered embedded app link, at the time of this writing it looks something like this, for Wikipedia linking to George Washington

 

jive_devslanding_transparent.png

<a class="jive-link-app-icon jive_macro jive_macro_appEmbeddedView"

  href="javascript:;"

  style="background-image: url('/servlet/JiveServlet/downloadImage/1921703/912085dac9d100cfd2786f126278fc317a845deb.png');"

  title="George Washington"

  jivemacro="appEmbeddedView"

  data-orig-content="George Washington&lt;span class=&quot;j-ui-elem j-app-link&quot;&gt;&lt;/span&gt;"

  __context="{&quot;page&quot;:&quot;George Washington&quot;}"

  __view="embedded"

  __action_id="com.jivesoftware.rte.wikipedia"

  __appuuid="2d3a78e7-22f7-486d-8f1f-86c8a65e6aa1"

  __icon="/servlet/JiveServlet/downloadImage/1921703/912085dac9d100cfd2786f126278fc317a845deb.png"

  __jive_macro_name="appEmbeddedView">George Washington<span class="j-ui-elem j-app-link"></span></a>

 

 

2.  Convert the pertinent data in the link to be generic variable(s)

 

Depending how complex the context of the app link is, you may need to use more than one form field reference, but in the case of the Wikipedia app, you only really need one field.  In this example the form field is going to have the ID of "subject" so all that needs to be done is to replace all occurrences of "George Washington" with {$subject}, which will look like this:

<a class="jive-link-app-icon jive_macro jive_macro_appEmbeddedView"

  href="javascript:;"

  style="background-image: url('/servlet/JiveServlet/downloadImage/1921703/912085dac9d100cfd2786f126278fc317a845deb.png');"

  title="{$subject}"

  jivemacro="appEmbeddedView"

  data-orig-content="{$subject}&lt;span class=&quot;j-ui-elem j-app-link&quot;&gt;&lt;/span&gt;"

  __context="{&quot;page&quot;:&quot;{$subject}&quot;}"

  __view="embedded"

  __action_id="com.jivesoftware.rte.wikipedia"

  __appuuid="2d3a78e7-22f7-486d-8f1f-86c8a65e6aa1"

  __icon="/servlet/JiveServlet/downloadImage/1921703/912085dac9d100cfd2786f126278fc317a845deb.png"

  __jive_macro_name="appEmbeddedView">{$subject}<span class="j-ui-elem j-app-link"></span></a>

 

Again, the amount of data / fields you need to create a link is going to likely vary quite a bit from app to app, and each data value you need in the embedded app link needs to be exposed somewhere in the form.  You could even be a bit tricky and expose 2 fields which separate the label of the embedded link from the data of the link, by replacing the last value (between the <a> tags) with another field, something like:

<a class="jive-link-app-icon jive_macro jive_macro_appEmbeddedView"

  href="javascript:;"

  style="background-image: url('/servlet/JiveServlet/downloadImage/1921703/912085dac9d100cfd2786f126278fc317a845deb.png');"

  title="{$linkText}"

  jivemacro="appEmbeddedView"

  data-orig-content="{$subject}&lt;span class=&quot;j-ui-elem j-app-link&quot;&gt;&lt;/span&gt;"

  __context="{&quot;page&quot;:&quot;{$subject}&quot;}"

  __view="embedded"

  __action_id="com.jivesoftware.rte.wikipedia"

  __appuuid="2d3a78e7-22f7-486d-8f1f-86c8a65e6aa1"

  __icon="/servlet/JiveServlet/downloadImage/1921703/912085dac9d100cfd2786f126278fc317a845deb.png"

  __jive_macro_name="appEmbeddedView">{$linkText}<span class="j-ui-elem j-app-link"></span></a>

 

 

In the above case, the app would still pull up an embedded view of the "subject" field of the form but the anchor link text and title would be a second field with ID "linkText" from the form.

 

3.  Put the generic forms link into a piece of HTML content used by the Forms app

 

All that has to be done here is to take the link, with the form parameters now included, and put that into some HTML.  The Forms app will look for and replace these {$field} substitutions in the embedded link just as it would in any other part of the HTML in the body.

 

Taking It for a Spin

 

Here is a sample template, using the above example, in which there is just one single field in the template, a subject:  Wiki Document Template

 

Here is the HTML which is used by the template to create a document with an embedded link to the Wikipedia app:  Wiki Document About {$subject}

 

Here is a sample of a document created by the template, which contains an embedded link to the Wikipedia article on George Washington:  Wiki Document About George Washington

 

You can use this direct link to the Forms app to point directly to this sample template and try to generate a Wikipedia document of your own.

 

Conclusion

 

And that's that...  You can now create a piece of content using the Forms app which actually contains an embedded link to another app.

 

One important little caveat, especially with Jive Cloud in play, is that updates of Jive may change how this link is formatted so content containing this links may or may not age gracefully through upgrades.  Giving that it patterns off of links created by Jive apps, the hope is that the links will safely live on, but there is no guarantee of that.

 

Questions, comments, feedback?