Jump to content

Longtail dynamic content with Squarespace

Recommended Posts

Hi community, 

I am planning to build out content pages for long-tail search terms like "Help with XYZ in Place XYZ". 

I'm looking for an easy way to create a lot of such pages with little effort. E.g. by uploading a spreadsheet with the data. Instead of having to create a ton of pages manually in the frontend. 

I was wondering if there is any good way of achieving this? E.g. by using code-blocks that allow me to implement content from a headless cms or is there any other good way of doing that?

Thanks for your support, 

Marvin

Link to comment
  • 1 year later...
  • Replies 2
  • Views 343
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

I don't have a solution but I may be able to point to a direction on the first part the the OP's question.

Quote

I'm looking for an easy way to create a lot of such pages with little effort. E.g. by uploading a spreadsheet with the data. Instead of having to create a ton of pages manually in the frontend. 

Little effort here is of course relative to having to do it all in the editor manually.

I would try to leverage SS's content import feature using the WordPress WXR (WordPress eXtended RSS) XML format. Be warned that the SS import process has always had its own challenges.

The following code is an example of WXR file with a single page that as of this post imports into the current of v7.1 of an SS site. I do not support this example in any way.

<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:excerpt="http://wordpress.org/export/1.2/excerpt/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:wp="http://wordpress.org/export/1.2/">
  <channel>
    <title>Your Site Title</title>
    <link>https://your-site.squarespace.com</link>
    <pubDate>Mon, 22 Jul 2024 19:00:14 +0000</pubDate>
    <description />
    <language>en-US</language>
    <wp:wxr_version>1.2</wp:wxr_version>
    <item>
      <link>/your-page-1</link>
      <title>Your Page 1</title>
      <pubDate>Mon, 22 Jul 2024 19:31:26 +0000</pubDate>
      <content:encoded><![CDATA[<article class="sections" id="sections" data-page-sections="669eb269e2c62a2978c29fd5">
  
  
    
    


  


<section
  data-test="page-section"
  
  data-section-theme=""
  class='page-section 
    
      full-bleed-section
      layout-engine-section
    
    background-width--full-bleed
    
      section-height--medium
    
    
      content-width--wide
    
    horizontal-alignment--center
    vertical-alignment--middle
    
      
    
    
    '
  
  data-section-id="669eb3747b39374b9fe3f7bf"
  
  data-controller="SectionWrapperController"
  data-current-styles="{
  &quot;imageOverlayOpacity&quot;: 0.15,
  &quot;backgroundWidth&quot;: &quot;background-width--full-bleed&quot;,
  &quot;sectionHeight&quot;: &quot;section-height--medium&quot;,
  &quot;customSectionHeight&quot;: 10,
  &quot;horizontalAlignment&quot;: &quot;horizontal-alignment--center&quot;,
  &quot;verticalAlignment&quot;: &quot;vertical-alignment--middle&quot;,
  &quot;contentWidth&quot;: &quot;content-width--wide&quot;,
  &quot;customContentWidth&quot;: 50,
  &quot;backgroundColor&quot;: &quot;&quot;,
  &quot;sectionTheme&quot;: &quot;&quot;,
  &quot;sectionAnimation&quot;: &quot;none&quot;,
  &quot;backgroundMode&quot;: &quot;image&quot;
}"
  data-current-context="{
  &quot;video&quot;: {
    &quot;filterStrength&quot;: 0,
    &quot;zoom&quot;: 0,
    &quot;videoSourceProvider&quot;: &quot;none&quot;
  },
  &quot;backgroundImageId&quot;: null,
  &quot;backgroundMediaEffect&quot;: null,
  &quot;divider&quot;: null,
  &quot;typeName&quot;: null
}"
  data-animation="none"
  data-fluid-engine-section
   
  
    
  
  
>
  <div
    class="section-border"
    
  >
    <div class="section-background">
    
      
    
    </div>
  </div>
  <div
    class='content-wrapper'
    style='
      
        
      
    '
  >
    <div
      class="content"
      
    >
      
      
      
      
      
      
      <div data-fluid-engine="true"><style>

.fe-669eb374d8dbbdda45e8ec3c {
  --grid-gutter: calc(var(--sqs-mobile-site-gutter, 6vw) - 11.0px);
  --cell-max-width: calc( ( var(--sqs-site-max-width, 1500px) - (11.0px * (8 - 1)) ) / 8 );

  display: grid;
  position: relative;
  grid-area: 1/1/-1/-1;
  grid-template-rows: repeat(13,minmax(24px, auto));
  grid-template-columns:
    minmax(var(--grid-gutter), 1fr)
    repeat(8, minmax(0, var(--cell-max-width)))
    minmax(var(--grid-gutter), 1fr);
  row-gap: 11.0px;
  column-gap: 11.0px;
}

@media (min-width: 768px) {
  .background-width--inset .fe-669eb374d8dbbdda45e8ec3c {
    --inset-padding: calc(var(--sqs-site-gutter) * 2);
  }

  .fe-669eb374d8dbbdda45e8ec3c {
    --grid-gutter: calc(var(--sqs-site-gutter, 4vw) - 11.0px);
    --cell-max-width: calc( ( var(--sqs-site-max-width, 1500px) - (11.0px * (24 - 1)) ) / 24 );
    --inset-padding: 0vw;

    --row-height-scaling-factor: 0.0215;
    --container-width: min(var(--sqs-site-max-width, 1500px), calc(100vw - var(--sqs-site-gutter, 4vw) * 2 - var(--inset-padding) ));

    grid-template-rows: repeat(4,minmax(calc(var(--container-width) * var(--row-height-scaling-factor)), auto));
    grid-template-columns:
      minmax(var(--grid-gutter), 1fr)
      repeat(24, minmax(0, var(--cell-max-width)))
      minmax(var(--grid-gutter), 1fr);
  }
}


  .fe-block-669eb374177a08ef56f82acc {
    grid-area: 1/2/14/10;
    z-index: 0;

    @media (max-width: 767px) {
      
        
      
    }
  }

  .fe-block-669eb374177a08ef56f82acc .sqs-block {
    justify-content: flex-start;
  }

  .fe-block-669eb374177a08ef56f82acc .sqs-block-alignment-wrapper {
    align-items: flex-start;
  }

  @media (min-width: 768px) {
    .fe-block-669eb374177a08ef56f82acc {
      grid-area: 1/2/5/26;
      z-index: 0;

      
        
      
    }

    .fe-block-669eb374177a08ef56f82acc .sqs-block {
      justify-content: flex-start;
    }

    .fe-block-669eb374177a08ef56f82acc .sqs-block-alignment-wrapper {
      align-items: flex-start;
    }
  }

</style><div class="fluid-engine fe-669eb374d8dbbdda45e8ec3c"><div class="fe-block fe-block-669eb374177a08ef56f82acc"><div class="sqs-block html-block sqs-block-html" data-blend-mode="NORMAL" data-block-type="2" data-border-radii="&#123;&quot;topLeft&quot;:&#123;&quot;unit&quot;:&quot;px&quot;,&quot;value&quot;:0.0&#125;,&quot;topRight&quot;:&#123;&quot;unit&quot;:&quot;px&quot;,&quot;value&quot;:0.0&#125;,&quot;bottomLeft&quot;:&#123;&quot;unit&quot;:&quot;px&quot;,&quot;value&quot;:0.0&#125;,&quot;bottomRight&quot;:&#123;&quot;unit&quot;:&quot;px&quot;,&quot;value&quot;:0.0&#125;&#125;" id="block-669eb374177a08ef56f82acc"><div class="sqs-block-content">

<div class="sqs-html-content">
  <p class="" style="white-space:pre-wrap;">Lorem ipsum odor amet, consectetuer adipiscing elit. Senectus himenaeos eget ipsum, turpis maecenas ullamcorper. Nunc magna ullamcorper nam libero blandit. Maecenas natoque mi, condimentum id sit aliquet rutrum. Praesent libero donec hendrerit nisl conubia finibus sit nunc. Arcu dui neque aliquam scelerisque euismod hac placerat placerat. Per nostra felis gravida mi sagittis ligula primis ullamcorper. Turpis proin libero iaculis; fusce felis mauris rhoncus? Malesuada per quam ultricies tortor ac platea. Habitant hac odio nulla molestie praesent sociosqu sociosqu.</p>
</div>




















  
  



</div></div></div></div></div>
    </div>
  
  </div>
  
</section>

  
</article>]]></content:encoded>
      <wp:post_name>your-page-1</wp:post_name>
      <wp:post_type>page</wp:post_type>
      <wp:post_id>0</wp:post_id>
      <wp:status>publish</wp:status>
    </item>
  </channel>
</rss>

Now the trick would be to use this example and come up with a way to populate the file using the item element as a template. I'd probably try to use Google Sheets and some formulas as a first try at the problem. GS might have some issue with the string lengths. If GS didn't work out then I'd be looking at a programming language or perhaps some old school Un*x tools.

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • 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.