Jump to content

Developer Platform: What are passthrough? and .main-image? targeting?

Recommended Posts

hi there,

this isn't anything that going to change my website but am hoping to just better understand the code / templating.

can someone help explain to me what .passthrough and .main-image are targeting? i couldn't find it in the docs anywhere.

i understand it's checking something but i'm just confused what exactly it's checking. main-image is obvious, but I don't see main-image on the json, but i do see passthrough.

sorry if the question is super vague!

thanks!michellea newbie in squarespace

Link to comment
  • Replies 2
  • Views 615
  • Created
  • Last Reply

This is super vague and it’s difficult to understand what you are seeking to understand. Can you explain where you are viewing these classes and why you want to understand more about them? It will help us if you include a working link to the page on the website too.

About me: I've been a SQSP User for 18 yrs. I was invited to join the Circle when it launched in 2016. I have been a Circle Leader since 2017. I don't work for Squarespace. I value honesty, transparency, diversity and good design ♥.
Work: I founded and run SF.DIGITAL, building Squarespace Extensions to supercharge your commerce website. 
Content: Views and opinions are my own. Links in my posts may refer to SF.DIGITAL products or may be affiliate links.
Forum advice is free. You can thank me by clicking one of the feedback emojis below. Coffee is optional.

Link to comment

Ahhh goodness you are right, that's so vague. I'm sorry! @Paul2009

i'm on the trial mode yet so i don't believe the website is live or i'd give the link.

I'm working in just the basic template and just trying to create an event collection and am putting together the event.list page and referencing the blog.list that the base template has. Below is the blog.list code i'm referencing.


 <article id="post-{id}" class="blog-list-item {@|item-classes}" data-item-id="{id}">
{.main-image?}
 <a href="{fullUrl}" class="main-image content-fill">
   <img {@|image-meta} />
 </a>
{.end}
<h1 class="title" data-content-field="title">
 {.passthrough?}
   <a href="{sourceUrl}" target="_blank">{title}</a>
 {.or}
   <a href="{fullUrl}">{title}</a>
 {.end}
</h1>
{.if excerpt}
 {excerpt}
 <a class="link" href="{fullUrl}">Read More</a>
{.or}
 {body}
{.end}



first question, on the 2nd line,**{.main-image?}***, this seems to me to be checking if the main image class is there and if so then posting the link. however, main-image is not a class within the blog items json. (am i phrasing this correct?)

my second question, on line 8, {.pass-through?}. this is a class within the blog items json, but I'm not sure what it's referencing.

i understand how to post / access the class for the image and the title from a blog or event, but i guess i'm more just trying to understand why these two things are part of the blog code. i'm not one to just copy and paste code and not understand it :)

anyways, hopefully i explained it a bit more clearly this time and if i didn't, well i'll keep trying.

thanks,michelle

Link to comment

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.