live-template query

  • 1
  • Question
  • Updated 1 year ago
Is there a supplier to tell me what live-template a page is based on?
Photo of Kathryn Moye

Kathryn Moye

  • 223 Posts
  • 12 Reply Likes

Posted 1 year ago

  • 1
Photo of andrew.vaningen

andrew.vaningen

  • 587 Posts
  • 59 Reply Likes
You could see it in content:body I think
Photo of Kathryn Moye

Kathryn Moye

  • 223 Posts
  • 12 Reply Likes
Thanks! I tried this but content:body and content:body>text:trim aren't outputting anything.!
It says the content:body is of datatype text so I'm surprised none of this is outputting anything.  I suspect that the internal parameters of the macro, such as the name of template in the live-template macro, are not accessible via content:body?
Photo of andrew.vaningen

andrew.vaningen

  • 587 Posts
  • 59 Reply Likes
maybe with page:body ?
Photo of Kathryn Moye

Kathryn Moye

  • 223 Posts
  • 12 Reply Likes
No go, unfortunately.  Just in case it helps someone, here is my report code.  I want to format the data differently based on which template it is using.

<code>
<ac:structured-macro ac:macro-id="8753545c-5b21-45f4-a179-8ef8e2191225" ac:name="run" ac:schema-version="1">
  <ac:parameter ac:name="dateFormat">MM-dd-yyyy</ac:parameter>
  <ac:parameter ac:name="heading">Enter Start and End Dates (format = "MM-dd-yyyy")</ac:parameter>
  <ac:parameter ac:name="replace">CostStart:$current_time:Disposition Start Date:date:::MM-dd-yyyy,CostEnd:$current_time:Disposition End Date:date:::MM-dd-yyyy</ac:parameter>
  <ac:parameter ac:name="titleRun">Create All Cost Report for Date Range</ac:parameter>
  <ac:parameter ac:name="atlassian-macro-output-type">BLOCK</ac:parameter>
  <ac:rich-text-body>
    <h2>
      <strong>All Costs (CRs and MDs) </strong>between $CostStart and $CostEnd:</h2>
    <ac:structured-macro ac:macro-id="5ce88c29-467b-4c8e-9b6e-cb3b7b6827bc" ac:name="table-filter" ac:schema-version="1">
      <ac:parameter ac:name="inverse">,,</ac:parameter>
      <ac:parameter ac:name="default">,,</ac:parameter>
      <ac:parameter ac:name="cell-width">,,</ac:parameter>
      <ac:parameter ac:name="sparkName">Sparkline</ac:parameter>
      <ac:parameter ac:name="userfilter">FY Listed</ac:parameter>
      <ac:parameter ac:name="column">Number,Prime or Non-Prime</ac:parameter>
      <ac:parameter ac:name="datepattern">yy-mm-dd</ac:parameter>
      <ac:parameter ac:name="id">1480829106276_1725074953</ac:parameter>
      <ac:parameter ac:name="separator">Point (.)</ac:parameter>
      <ac:parameter ac:name="order">0,1,2</ac:parameter>
      <ac:rich-text-body>
        <ac:structured-macro ac:macro-id="553511ae-6554-458f-a66d-efd3d3d14332" ac:name="report-table" ac:schema-version="1">
          <ac:rich-text-body>
            <ac:structured-macro ac:macro-id="f6955c24-f723-4344-bfe3-16eed9fb45a6" ac:name="combining-reporter" ac:schema-version="1">
              <ac:rich-text-body>
                <ac:structured-macro ac:macro-id="e63d4746-54a8-4297-b4ca-bd379348c61c" ac:name="local-reporter" ac:schema-version="1">
                  <ac:parameter ac:name="source">Orion MPCV Change Request List</ac:parameter>
                  <ac:parameter ac:name="">page:children</ac:parameter>
                  <ac:rich-text-body>
                    <p> </p>
                  </ac:rich-text-body>
                </ac:structured-macro>
                <ac:structured-macro ac:macro-id="5e9bcbad-dd65-4f0c-86f5-4cb4ee9e5e25" ac:name="local-reporter" ac:schema-version="1">
                  <ac:parameter ac:name="source">Orion MPCV Assessment Change Request List</ac:parameter>
                  <ac:parameter ac:name="">page:children</ac:parameter>
                  <ac:rich-text-body>
                    <p> </p>
                  </ac:rich-text-body>
                </ac:structured-macro>
                <ac:structured-macro ac:macro-id="6c48ae0b-41a5-4199-86ec-6786c2d51146" ac:name="local-reporter" ac:schema-version="1">
                  <ac:parameter ac:name="source">Orion MPCV Management Directives List</ac:parameter>
                  <ac:parameter ac:name="">page:children</ac:parameter>
                  <ac:rich-text-body>
                    <p> </p>
                  </ac:rich-text-body>
                </ac:structured-macro>
                <p>
                  <ac:structured-macro ac:macro-id="8f9b6ff8-92ba-43f3-bbab-d68b0199eafb" ac:name="date-filter" ac:schema-version="1">
                    <ac:parameter ac:name="minValue">$CostStart</ac:parameter>
                    <ac:parameter ac:name="maxValue">$CostEnd</ac:parameter>
                    <ac:parameter ac:name="format">MM-dd-yyyy</ac:parameter>
                    <ac:parameter ac:name="required">true</ac:parameter>
                    <ac:parameter ac:name="">data:DispositionDate</ac:parameter>
                  </ac:structured-macro>
                </p>
                <p>
                  <ac:structured-macro ac:macro-id="f9d963c4-3efd-4de8-9ea6-9d82e1b8d944" ac:name="text-filter" ac:schema-version="1">
                    <ac:parameter ac:name="include">.*Yes.*</ac:parameter>
                    <ac:parameter ac:name="">data:CostImp</ac:parameter>
                  </ac:structured-macro> <ac:structured-macro ac:macro-id="e6794396-3a2c-4c8e-a24d-a581443d4ac7" ac:name="date-sort" ac:schema-version="1">
                    <ac:parameter ac:name="">data:DispositionDate</ac:parameter>
                  </ac:structured-macro>
                </p>
              </ac:rich-text-body>
            </ac:structured-macro>
            <ac:structured-macro ac:macro-id="97dafc6b-07d0-4210-87ce-bd2eb63161a1" ac:name="report-column" ac:schema-version="1">
              <ac:parameter ac:name="title">Title</ac:parameter>
              <ac:rich-text-body>
                <p>
                  <ac:structured-macro ac:macro-id="3ae9dc0d-80e8-44c2-a5cd-4f54f0537776" ac:name="report-info" ac:schema-version="1">
                    <ac:parameter ac:name="">data:CRTitle</ac:parameter>
                  </ac:structured-macro>
                </p>
                <p>
                  <ac:structured-macro ac:macro-id="18c3259c-9527-484a-a3cc-ac0378a8a44f" ac:name="report-info" ac:schema-version="1">
                    <ac:parameter ac:name="">data:CRRef &gt; first &gt; data:CRTitle</ac:parameter>
                  </ac:structured-macro>
                </p>
              </ac:rich-text-body>
            </ac:structured-macro>
            <ac:structured-macro ac:macro-id="66b0f160-b1e1-497a-8450-2f536ec60c3e" ac:name="report-column" ac:schema-version="1">
              <ac:parameter ac:name="title">Description</ac:parameter>
              <ac:rich-text-body>
                <p>
                  <ac:structured-macro ac:macro-id="6bf2c15b-83ea-443b-87c1-f345d926168d" ac:name="report-block" ac:schema-version="1">
                    <ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter>
                    <ac:rich-text-body>
                      <ac:structured-macro ac:macro-id="4af78cf0-cb6e-4742-8575-8dfa667c0084" ac:name="local-reporter" ac:schema-version="1">
                        <ac:parameter ac:name="">report:item</ac:parameter>
                        <ac:rich-text-body>
                          <p> </p>
                        </ac:rich-text-body>
                      </ac:structured-macro>
                      <ac:structured-macro ac:macro-id="9ca31782-1a8b-4dc1-bada-eb516e1e296b" ac:name="report-body" ac:schema-version="1">
                        <ac:rich-text-body>
                          <p>
                            <ac:structured-macro ac:macro-id="9a6a550f-896a-41bd-8fca-1c2a349173cd" ac:name="report-info" ac:schema-version="1">
                              <ac:parameter ac:name="render">richtext</ac:parameter>
                              <ac:parameter ac:name="">data:CRDesc</ac:parameter>
                            </ac:structured-macro>
                          </p>
                        </ac:rich-text-body>
                      </ac:structured-macro>
                      <ac:structured-macro ac:macro-id="11e7a3fc-2bc2-41c1-92ca-c8db979b641b" ac:name="report-empty" ac:schema-version="1">
                        <ac:rich-text-body>
                          <p>
                            <ac:structured-macro ac:macro-id="9cd9005b-5d91-4ff8-92cc-e877a254a9c7" ac:name="report-info" ac:schema-version="1">
                              <ac:parameter ac:name="">data:CRDesc</ac:parameter>
                            </ac:structured-macro> </p>
                        </ac:rich-text-body>
                      </ac:structured-macro>
                    </ac:rich-text-body>
                  </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>
<p> </p>
<p> </p>

</code>
Photo of Kathryn Moye

Kathryn Moye

  • 223 Posts
  • 12 Reply Likes
Reporting 6.4.4
Scaffolding 8.7.2
Confluence 5.8.18
Photo of Samuel Gatica

Samuel Gatica, Alum

  • 33 Posts
  • 2 Reply Likes
Photo of Kathryn Moye

Kathryn Moye

  • 223 Posts
  • 12 Reply Likes
I'm not sure why you are pointing me to the documentation.  I am using live-template already on hundreds of pages.  I want to know how to query a page to find out the name of the template or page the page is based on.
So, if live-template uses Template ABC I want it to return "ABC".  If it uses Template ABC R1 I want it to return "ABC R1".  I don't know what supplier to use to get this information of if it is even possible.

Katy
Photo of Kathryn Moye

Kathryn Moye

  • 223 Posts
  • 12 Reply Likes
Here is the solution.  
content:body>body:text.  Thanks to Andrew for starting me down the content body path!