Jump to content

loading content from other pages

Recommended Posts

Posted

i have a custom template where i would like to include a content block from another page and reuse this content block multiple times.

I tried using squarespace:query tag however in the json loaded i dont see any content.

for example the code would look similar to this

mainpage.region

<div>
  <squarespace:query collection="page-1">
    <!-- get content from page 1 -->
  </squarespace:query>
</div>

<div>
  <squarespace:query collection="page-2">
    <!-- get content from page 2 -->
  </squarespace:query>
</div>


<div>
  <squarespace:query collection="page-1">
    <!-- get content from page 1 again -->
  </squarespace:query>
</div>

How can i accomplish this?

  • Replies 2
  • Views 749
  • Created
  • Last Reply
Posted
11 hours ago, anthonynformal said:

i have a custom template where i would like to include a content block from another page and reuse this content block multiple times.

I tried using squarespace:query tag however in the json loaded i dont see any content.

for example the code would look similar to this

mainpage.region

<div>
  <squarespace:query collection="page-1">
    <!-- get content from page 1 -->
  </squarespace:query>
</div>

<div>
  <squarespace:query collection="page-2">
    <!-- get content from page 2 -->
  </squarespace:query>
</div>


<div>
  <squarespace:query collection="page-1">
    <!-- get content from page 1 again -->
  </squarespace:query>
</div>

How can i accomplish this?

I usually query external page with javascript via json-pretty param

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Pinch/Zoom images, videos - PDFs Lightbox - ...) </>  🗓️ Delivery Date Picker (Date picker form field)
Gallery block 7.1 workaround </> 🤖 Ask me anything

  • 1 month later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.