title: How can I render a link on a Powermail confirmation/submit page?
body: <p>I'm trying to place a link on the submit page of my powermail setup.</p>
  
  <p><img src="https://i.stack.imgur.com/s6NSJ.png" alt="enter image description here"></p>
  
  <p>You'd think this is a simple task, but bear with me.</p>
  
  <p>My Powermail form has 2 hidden fields which are prefilled with a page ID and a page title. </p>
  
  <p><img src="https://i.stack.imgur.com/mYzS2.png" alt="enter image description here"></p>
  
  <p>These belong to the page I later want to return to, after having sent the mail. By putting these values in the form, I hoped to have access to them whenever I need them in the process.</p>
  
  <p>I prefill these hidden fields from TypoScript like so:</p>
  
  <pre><code>plugin.tx_powermail {
    settings {
      setup {
        prefill {
          // Hidden "back to" page ID. This is the page you may want to return to after sending a mail.
          backto = TEXT
          backto.data             = GP:backTo
          backto.if.isTrue.data   = GP:backTo
  
          backtotext = TEXT
          backtotext.noTrimWrap       = |Back to ||
          backtotext.data             = GP:title
          backtotext.if.isTrue.data   = GP:title
          backtotext.htmlSpecialChars = 1
        }
      }
    }
  }
  </code></pre>
  
  <h2>1. Approach</h2>
  
  <p>Given that Powermail claims you can now use Fluid ViewHelpers in your content sections, I though, great, let's use the PageViewHelper, like so:</p>
  
  <pre><code>{f:link.page(pageUid:'{backto}')}
  </code></pre>
  
  <p>But where does my link text go? More inline notation to the rescue!</p>
  
  <pre><code>{backtotext -&gt; f:link.page(pageUid:'{backto}')}
  </code></pre>
  
  <h3>Rendered Result</h3>
  
  <p><img src="https://i.stack.imgur.com/W4hnk.png" alt="enter image description here"></p>
  
  <p>Seems like the inline notation is not fully supported. I thought I was smart by simply using:</p>
  
  <pre><code>{f:link.page(pageUid:'{backto}')}{backtotext}
  </code></pre>
  
  <p>But this leaves the <code>&lt;a&gt;</code> tag open, which has very undesirable effects...</p>
  
  <p>So - No link for me!</p>
  
  <h2>2. Approach</h2>
  
  <p>So I thought I would simply construct the link in TypoScript and render it on the page via</p>
  
  <pre><code>{f:cObject(typoscriptObjectPath:'lib.myBackLink')}
  </code></pre>
  
  <p>But I can't see any way to access the variables from the (sent) Powermail form in TS. So I don't have access to the page ID or title.</p>
  
  <h2>3. Approach</h2>
  
  <p>So I thought, if the default PageViewHelper only wants to render its children as its content, maybe I can roll my own ViewHelper that accepts the content as a parameter!</p>
  
  <p>But how would I make that ViewHelper known to the system so that I can use it in my customized Powermail templates?</p>
  
  <p>I've only used Fluid inside of my extensions before. It was obvious how Fluid would look up the correct ViewHelper by name, by what if I want to use a ViewHelper in my fileadmin folder hierarchy?</p>
  
  <h2>4. Approach</h2>
  
  <p>So, why not just use a <em>normal</em> link by using <code>&lt;a href="http://www.page.com/?id={backto}"&gt;{backtotext}&lt;/a&gt;</code> in the RTE?</p>
  
  <p>TYPO3 realizes, that that is an illegal reference, and quickly turns the link into:<br>
  <img src="https://i.stack.imgur.com/i50Yj.png" alt="enter image description here"><br>
  And the resulting output will simply not be a link.</p>
  
  <p>So, that doesn't work either.</p>
  
  <p>OK, so I change the target to <code>&lt;a href="http://www.page.com?id={backto}"&gt;{backtotext}&lt;/a&gt;</code> (removed a slash). Now the URL is no longer recognized as internal and is marked with <code>data-htmlarea-external="1"</code>. This causes my link to actually be fully evaluated and rendered (yay). </p>
  
  <p>But it is now treated like an external link, RealURL no longer affects it and it is subject to external link <code>_target</code> behavior.</p>
  
  <p>Why is this so difficult? What am I not understanding?</p>