Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

In this section, you will be creating the workaround to the Incoming Links macro by making use of REP.

This workaround will be able to detect links from other pages from within Scaffolding macros that link to the current page. In this example the Scaffolding macro structure used is the one we created in Part 1 - Creating the Scaffolding macro structure.

...

For more information on how to use this source code on your Confluence, read the following article:

Expand
titleClick here for the source code...


Code Block
<ac:structured-macro ac:macro-id="dd5d3949-cf06-4ca8-89e8-2011e80af547" ac:name="report-block" ac:schema-version="1">
  <ac:parameter ac:name="injected">true</ac:parameter>
  <ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter>
  <ac:rich-text-body>
    <ac:structured-macro ac:macro-id="9b1377d7-9261-4e9d-8178-225bb81ef0d4" ac:name="local-reporter" ac:schema-version="1">
      <ac:parameter ac:name="">@self</ac:parameter>
      <ac:rich-text-body>
        <p>
          <br/>
        </p>
      </ac:rich-text-body>
    </ac:structured-macro>
    <ac:structured-macro ac:macro-id="58110463-dd54-4096-ae9d-1cfc458c3697" ac:name="report-header" ac:schema-version="1">
      <ac:rich-text-body>
        <ac:structured-macro ac:macro-id="81e66481-7026-44e5-bd6d-ccfa03b8ba4a" ac:name="report-variable" ac:schema-version="1">
          <ac:parameter ac:name="name">X</ac:parameter>
          <ac:parameter ac:name="value">%page:title%</ac:parameter>
          <ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter>
          <ac:rich-text-body>
            <p>
              <br/>
            </p>
          </ac:rich-text-body>
        </ac:structured-macro>
      </ac:rich-text-body>
    </ac:structured-macro>
    <ac:structured-macro ac:macro-id="8d58ca5e-937e-4740-9e2a-3fe9acaf609f" ac:name="report-body" ac:schema-version="1">
      <ac:rich-text-body>
        <ac:structured-macro ac:macro-id="d6a054b0-4f65-42a1-b5b3-ba27dda26e81" ac:name="report-block" ac:schema-version="1">
          <ac:parameter ac:name="injected">true</ac:parameter>
          <ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter>
          <ac:rich-text-body>
            <ac:structured-macro ac:macro-id="593fb6d9-16fe-465c-903a-0f2bbee18b0b" ac:name="content-reporter" ac:schema-version="1">
              <ac:parameter ac:name="types">page</ac:parameter>
              <ac:parameter ac:name="spaces">
                <ri:space ri:space-key="@all"/>
              </ac:parameter>
              <ac:rich-text-body>
                <p class="auto-cursor-target">
                  <ac:structured-macro ac:macro-id="9a93affd-253c-4f49-a708-38eb675a7d32" ac:name="text-filter" ac:schema-version="1">
                    <ac:parameter ac:name="contains">%variable:X%</ac:parameter>
                    <ac:parameter ac:name="minLength">1</ac:parameter>
                    <ac:parameter ac:name="">data:target</ac:parameter>
                  </ac:structured-macro>
                </p>
              </ac:rich-text-body>
            </ac:structured-macro>
            <ac:structured-macro ac:macro-id="4f7578e6-1f87-4d27-8935-745f1a14ec1e" ac:name="report-body" ac:schema-version="1">
              <ac:parameter ac:name="injected">true</ac:parameter>
              <ac:rich-text-body>
                <p>
                  <ac:structured-macro ac:macro-id="2f67e744-7f87-405e-bfec-5ecd6f10ea61" ac:name="report-info" ac:schema-version="1">
                    <ac:parameter ac:name="link">true</ac:parameter>
                    <ac:parameter ac:name="">page:title</ac:parameter>
                  </ac:structured-macro>
                </p>
              </ac:rich-text-body>
            </ac:structured-macro>
          </ac:rich-text-body>
        </ac:structured-macro>
      </ac:rich-text-body>
    </ac:structured-macro>
  </ac:rich-text-body>
</ac:structured-macro>


...

  1. Add a Report Block macro.
    Check its Injected parameter.
    Create a Local Reporter macro and set the Key parameter to "@self".

  2. Add a Report Header macro.

  3. Within the Report Header macro, create a Report Variable macro.
    Set its Name parameter to "X" and Value parameter to "%page:title%".

  4. Add a Report Body macro.

  5. Within the Report Body macro, add a Report Block macro.
    Check its Injected parameter.


  6. Within the Report Block macro, add a Content Reporter and a Report Body macro.
    Set Content Reporter's type parameter to "Page" and check the Report Body's Injected parameter.


  7. Within the Report Body macro, add a Report info macro.
    Set its Key to "page:title" and check the Link To Item parameter.


  8. Inside Content Reporter macro, add a Text Filter macro
    Set its key and contains parameters to "data:target" and "%variable:X%" respectively and click Save.


  9. Click on Edit contents, select your desired page and click Save.

...