mchellejae Posted August 31, 2019 Share Posted August 31, 2019 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
paul2009 Posted August 31, 2019 Share Posted August 31, 2019 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. Me: I'm Paul, a SQSP user for >18 yrs & Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥. Work: Founder of SF.DIGITAL. We provide high quality original extensions to supercharge your Squarespace website. Content: Views and opinions are my own. Links in my posts may refer to my own SF.DIGITAL products or may be affiliate links. Forum advice is completely free. You can thank me by selecting a feedback emoji. Buying a coffee is generous but optional. Would you like your customers to be able to mark their favourite products in your Squarespace store? Link to comment
mchellejae Posted August 31, 2019 Author Share Posted August 31, 2019 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
Recommended Posts
Archived
This topic is now archived and is closed to further replies.