Im customizing a theme in Big Commerce and am having issues. I've never used this platform before and I am having trouble finding where and how to add code. On the home page I've added 2 new parts following the product listings. I dont undrstand the {{partial}} blocks of code. I tried adding my own and it didnt work. What did work was just adding my code to an existing {{partial}}. I added the following to the partial="page":
{{#partial "page"}}
{{#each shipping_messages}}
{{> components/common/alert-info message}}
{{/each}}
<div class="main full">
{{#if products.featured}}
{{> components/products/featured products=products.featured columns=theme_settings.homepage_featured_products_column_count}}
{{/if}}
{{#if products.top_sellers}}
{{> components/products/top products=products.top_sellers columns=theme_settings.homepage_top_products_column_count}}
{{/if}}
{{#if products.new}}
{{> components/products/new products=products.new columns=theme_settings.homepage_new_products_column_count}}
{{/if}}
</div>
<div class="message">
<div class="recycle">
<p class="light">Recycling takes a little effort on your part, but</p>
<div class="recycle-image">
<img src="https://res.cloudinary.com/adamscloud/image/upload/v1518463871/recycled-min_vwz3rb.png">
</div>
<p class="light">makes a Big difference to the World</p>
</div>
<div class="mission">
<h2>Our Mission</h2>
<p class="mission-text">
We offer unique hand crafted, recycle, upcycled, repurposed, comfortable, trendy, creative, cutting edge, ironically humorous, catchy, cool, inspiring items that are unisex and are for people of all ages from all walks of life.</p>
<p class="mission-text">Our goal is to put a smile on the Face of the World by inspiring, entertaining, bringing joy and laughter iinto peoples lives while cherishing our Mother Earth.</p>
<h2>READ MORE</h2>
</div>
</div>
<div class="gallery-image">
<div class="pic-group">
<div class="row">
<div class="small-12 large-3 columns pic-frame"><img class="pics" src="https://res.cloudinary.com/adamscloud/image/upload/v1518476220/gal-1_iryamj.png"></div>
<div class="small-12 large-3 columns pic-frame"><img class="pics" src="https://res.cloudinary.com/adamscloud/image/upload/v1518476222/gal-2_xnmdtp.png"></div>
<div class="small-12 large-3 columns pic-frame"><img class="pics" src="https://res.cloudinary.com/adamscloud/image/upload/v1518476220/gal-3_icq64o.png"></div>
<div class="small-12 large-3 columns pic-frame"><img class="pics" src="https://res.cloudinary.com/adamscloud/image/upload/v1518476223/gal-4_ei72ob.png"></div>
<div class="small-12 large-3 columns pic-frame"><img class="pics" src="https://res.cloudinary.com/adamscloud/image/upload/v1518476224/gal-5_yvljkk.png"></div>
<div class="small-12 large-3 columns pic-frame"><img class="pics" src="https://res.cloudinary.com/adamscloud/image/upload/v1518476224/gal-6_lksrsb.png"></div>
</div>
</div>
</div>
<div class="events pic-group">
<h1>You're Cool, We're Cool,</h1>
<p>come see us at a event near you.</p>
</div>
{{/partial}}
My problem is I cannot get it to work on responsive. When I test on mobile the images are stretched out and 2 are set side by side. I though Big commerce uses Foundation? I tried adding columns to the section but it still doesn't work. Could someone please show me how to make this code I added responsive? Any sources on how to code in Big Commerce because it is frustrating. I am using the cornerstone theme.
To make your gallery grid responsive and use built-in Foundation classes in Cornerstone, set this variable to true in assets/scss/settings/global/_global.scss:
$include-html-classes: true !default;
This variable exposes Foundation classes from Citadel, which is a pattern library custom to Stencil. This PR goes into a bit more detail: https://github.com/bigcommerce/cornerstone/pull/1047
Related
I've been trying to re-order my bootstrap columns when in mobile view but my code is just not working. Most probably because I am doing something incorrect.
Here is my markup:
<div class="container">
<div class="row text-center">
<div class="col-12">
<h2 class="mb-lg-4 mb-sm-3">Early Stages</h2>
</div>
<div class="col-md-7 col-sm-push-5">
<p>Also known as 'the Poor Fellow-Soldiers of Christ and of the Temple of Solomon', the Knights Templars were originally founded circa 1120 CE, by Hugues de Payens, as a means to protect Christian pilgrims to the Holy Land. It was originally intended that nine Templars would protect the pilgrims.</p>
</div>
<div class="col-md-5 col-sm-push-7">
Image Here
</div>
</div><!--/row-->
</div>
What I am trying to do is essentially make the "Image Here" section go above the "also known as the poor etc." section when in mobile view (col-sm). I looked at Bootstraps guide but I think I am understanding it incorrectly, can someone show me how its done?
Thanks in advance
Try this HTML
<div class="container">
<div class="row text-center">
<div class="col-12">
<h2 class="mb-lg-4 mb-sm-3">Early Stages</h2>
</div>
<div class="col-md-5 col-sm-push-7">
Image Here
</div>
<div class="col-md-7 col-sm-pull-5">
<p>Also known as 'the Poor Fellow-Soldiers of Christ and of the Temple of Solomon', the Knights Templars were originally founded circa 1120 CE, by Hugues de Payens, as a means to protect Christian pilgrims to the Holy Land. It was originally
intended that nine Templars would protect the pilgrims.</p>
</div>
</div>
<!--/row-->
Link for reference
hope this helps..
This is probably an easy one, but I'm new to bootstrap and aren't quite familiar with how it works. I have the following code to create 4 even-width columns in a row. But it keeps showing up as 4 vertically stacked columns on my laptop (1920x1080) and I'm not quite sure where I'm doing it wrong.
<div class="container">
<div class="row-fluid">
<div class="col-md-3"><!--about us feature 1st -->
<div class="about-block">
<div class="heading">
<h6>AVAILABILITY</h6>
<p>Fast Response Time<br> 15 Minutes Setup</p>
</div>
</div>
</div><!--about us feature 1st closed -->
<div class="col-md-3"><!--about us feature 2nd -->
<div class="about-block">
<div class="heading">
<h6>SPEED</h6>
<p>Average 7x Faster<br> Complete Data Coverage</p>
</div>
</div>
</div> <!--about us feature 2nd closed -->
<div class="col-md-3"><!--about us feature 3rd -->
<div class="about-block">
<div class="heading">
<h6>SAFETY</h6>
<p>Reduce Human Risk<br> No Scaffolding</p>
</div>
</div>
</div><!--about us feature 3rd closed -->
<div class="col-md-3"><!--about us feature 4th -->
<div class="about-block">
<div class="heading">
<h6>COST SAVINGS</h6>
<p>Targeted Repairs<br> Less Outage Time</p>
</div>
</div>
</div><!--about us feature 4th closed -->
</div>
</div>
UPDATE Added screenshot:
Use col-sm-3 instead, or make your <div> element wider. If you are using a container directly inside body, you shouldn't have any problem. If you are using inside another element, make sure it is wide enough.
First, try changing row-fluid class to style="float: left". Second, it is true that (in theory) the screen is divided into 12, but 3*4 might be more than 12 (margin, border, etc.). If the first part renders three columns and the 4th underneath, try reducing the size of the columns by setting, for instance, width=24%.
I have a Project where many developers are going to inherit my code. I am working mainly on the HTML, CSS and some JavaScript. I am using Foundation 5 and many of the developers (Mostly NodeJS and JavaSCript programmers) are unfamiliar with Responsive Frameworks like Foundation & Bootstrap. They do understand media queries and css very well, but simply have not worked with the 12 column layout etc..
I have a few very complex layout where there are nested grids. I have commented the heck out of these areas so that they will understand if I'm gone or not around to help with something later. I am using comments in conjunction with name="Content-Container", or name="Left-Column" & name="Right-Column". So I am using the name element as kind of description. The pages are super easy to read and understand now despite the complex hierarchy.
I have a comment at the top of each page that says:
<!-- README: This page contains many comments to aid in debugging, etc.. -->
<!-- There are many div's with a name element. These name elements were not-->
<!-- made to be targeted with css. These name elements are descriptions -->
<!-- to aid with understanding their purpose. -->
IS this a good idea? Am I opening up a can of worms by giving them alternate ways of targeting these divs when I'm gone that shouldn't be used when they should instead be using the existing classes and ID's?
Should I not use these names and instead only use commenting? I have never worked with a large team. They seem to understand that I have brought some order and organization to their code. I have completely restructured their entire site, but I don't want to add more complexity if not needed or the ability for them to use these unintentionally.
Your comments are encouraged, I'm seeking advice from those who are used to working on larger teams where they may see me shooting myself in the foot here.
BELOW IS A SAMPLE OF WHAT I'M DOING:
<!--All Content goes inside here. At the time of this writing it
contains two columns that will stack vertically on small screens-->
<div class="row" name="Content-Container">
<!--This is the left hand column that takes up 7 of 12 columns-->
<div class="medium-7 columns" name="Left-Column">
<!--This starts a row to hold many 12 column content containers (Search, Filter, Image & Search Results)-->
<div class="row" name="Left Column Row-Container">
<!-- Start Search Row-->
<div class="medium-12 columns">
<div class="searchWikiMargin">
<form name="searchForm" action="/">
<div class="row collapse">
<div class="small-10 columns">
<input type="search" name="q" id="autoSearch" placeholder="Search local and beyond..." class="placehold">
</div>
<div class="small-2 columns">
Search
</div>
</div>
</form>
</div>
</div>
<!-- End Search Row-->
<!-- Start Filter Navigation Row-->
<div class="medium-12 columns">
<dl class="sub-nav">
<dt>Filter:</dt>
<dd class="active">Web</dd>
<dd>Images</dd>
<dd>News</dd>
<dd>All</dd>
</dl><hr>
</div>
<!-- End Filter Navigation Row-->
<!-- Start Mobile Wiki Results Row ~NO TOP MARGIN SHOWS ONLY ON SMALL SCREENS-->
<div class="small-12 columns show-for-small-only">
<div>
<img src="...">
</div>
</div>
<!-- End Mobile Wiki Results Row-->
<!-- Start Image Results Row-->
<div class="medium-12 columns">
<h5>Image Results For tj hooker</h4>
<ul class="small-block-grid-3">
<li><img class="th" src="eb_images/tj-01.jpg" height="50"></li>
<li><img class="th" src="eb_images/tj-02.jpg" height="50"></li>
<li><img class="th" src="eb_images/tj-03.jpg" height="50"></li>
<li><img class="th" src="eb_images/tj-04.jpg" height="50"></li>
<li><img class="th" src="eb_images/tj-05.jpg" height="50"></li>
<li><img class="th" src="eb_images/tj-06.jpg" height="50"></li>
</ul>
</div>
<!-- End Image Results Row-->
<!-- Start Search Results Row-->
<div class="medium-12 columns">
<h5>Image Results For tj hooker</h4>
<img src="eb_images/tjresults.png">
</div>
<!-- End Search Results Row-->
</div><!--End "Left-Column-Row-Container" -->
</div><!--End "Left-Column" -->
<!--This is the right hand column that takes up 5 of 12 columns-->
<div class="medium-5 columns show-for-medium-up" name="Right-Column">
<!--This starts a row to hold one 12 column content container (Wiki)-->
<div class="row" name="Right-Column-Row-Container">
<!-- Start Mobile Wiki Results Row ~HAS TOP MARGIN & SHOWS ONLY ON MEDIUM & LARGE (DESKTOP) SCREENS-->
<div class="medium-12 columns">
<div class="searchWikiMargin">
<img src="eb_images/tjwiki.png">
</div>
</div>
<!-- End Mobile Wiki Results Row-->
</div><!--End "Right-Column-Row-Container"-->
</div><!--End "Right-Column"-->
</div><!--End Row "Content-Container"-->
This is just one portion of the page.
"Am I opening up a can of worms by giving them alternate ways of targeting these divs "
YES. My reasoning: in the long run you will eventually want all of that extra stuff to lose its usefulness (you want your team to eventually function without extra help).
You answered your own question, I believe.
"Should I not use these names and instead only use commenting?"
YES. Use extra comments, comment the heck out of it. Comments don't change code.
I am using microformat for the first time.
So as examples given on http://support.google.com/webmasters/bin/answer.py?hl=en&answer=164506, I changed the code.
This is the existing code that was present on the page:
<div class="evD mr10">
<div class="imgH fl"><img /></div>
<div class="infAr">
<h3>EVENT NAME</h3>
<h4><span>at</span>VENUE NAME</h4>
<p>Event Description</p>
<a class="tdd" href="#">Genre</a>
</div>
<div class="dth">
<div class="sfrD fl">
</div>
<div class="strE sn fl">
</div>
<div class="Buy">
<a class="bkT" href="buy_link"></a>
</div>
</div>
</div>
The Changes I made include :
Change the doctype to html5, and added microformat classes.
<div class="vevent evD mr10">
<div class="imgH fl"><img class="photo" /></div>
<div class="infAr">
<h3><a class="url summary" href="event_URL">EVENT NAME</a></h3>
<h4 class="location"><span>at</span>VENUE NAME</h4>
<p class="description">Event Description</p>
Genre
</div>
<div class="dth">
<div class="dtstart frD fl">DATE_START<span class="value-title" title="Date in ISO"></span></div>
<div class="dtend strE sn fl"><span class="value-title" title="Date in ISO"></span></div>
<div class="Buy tickets">
<a class="bkT offerurl" href="buy_link"></a>
</div>
</div>
</div>
I have the following questions/doubts :
Is it ok to have existing classes alongwith the microformat tags as done above?
As mentioned on http://support.google.com/webmasters/bin/answer.py?hl=en&answer=1093493#usage, it is not allowed to have display:none on the content. However, I pass the data set and paginate using javascript, in which I show the relevant data. So how do I make sure that these is not ignored.
I load the images which are on the current page, leaving the src as blank, and later change the src, as the page is changed. So initally the event's photo is blank.
How do I counter from a search engine reading as blank.
Thank you.
(Sorry about the question being so long)
1) that is no problem. You can even combine multiple types of semantic markup on the same tags.
2) 3)
If the data is hidden and in JavaScript/AJAX then it is highly unlikely Google will see it.
You may have to restructure your architecture to make your content crawlable. That's a big subject. I suggest looking up "progressive enhancement" which is the method I currently think is best.
For those veterans who haven't tried Hpple, it's great. It uses Xpath for searching through HTML/XML documents. It gets the job done and it's easy enough for a newbie like me to understand. However, I'm having trouble.
I have this chunk of HTML:
<ul class="challengesList dailyChallengesList">
<li>
<div class="corner topLeft"></div>
<img id="ctl00_mainContent_dailyChallengesRepeater_ctl00_challengeImage" title="Gunslinger" src="/images/reachstats/challenges/0.png" alt="Gunslinger" style="border-width:0px;">
<div class="info">
<div class="rFloat">
<p id="ctl00_mainContent_dailyChallengesRepeater_ctl00_challengeExpiration" class="timeDisplay dailyExpirationCountdown"><span>0d</span><span>19h</span><span>9m</span><span class="seconds">37s</span></p>
<p>1500cR</p>
</div>
<h5>Gunslinger</h5>
<p class="description">Kill 150 enemies in multiplayer Matchmaking.</p>
<div class="reward">
<div id="ctl00_mainContent_dailyChallengesRepeater_ctl00_progressBox" class="barContainer">
<div id="ctl00_mainContent_dailyChallengesRepeater_ctl00_progressBar" class="bar" style="width:21%;"><span></span></div>
<p>31/150</p>
</div>
</div>
</div>
<div class="clear"></div>
</li>
<li>
<div class="corner topLeft"></div>
<img id="ctl00_mainContent_dailyChallengesRepeater_ctl01_challengeImage" title="A Great Friend" src="/images/reachstats/challenges/0.png" alt="A Great Friend" style="border-width:0px;">
<div class="info">
<div class="rFloat">
<p id="ctl00_mainContent_dailyChallengesRepeater_ctl01_challengeExpiration" class="timeDisplay dailyExpirationCountdown"><span>0d</span><span>19h</span><span>9m</span><span class="seconds">37s</span></p>
<p>1400cR</p>
</div>
<h5>A Great Friend</h5>
<p class="description">Earn 15 assists today in multiplayer Matchmaking.</p>
<div class="reward">
<div id="ctl00_mainContent_dailyChallengesRepeater_ctl01_progressBox" class="barContainer">
<div id="ctl00_mainContent_dailyChallengesRepeater_ctl01_progressBar" class="bar" style="width:40%;"><span></span></div>
<p>6/15</p>
</div>
</div>
</div>
<div class="clear"></div>
</li>
<li>
<div class="corner topLeft"></div>
<img id="ctl00_mainContent_dailyChallengesRepeater_ctl02_challengeImage" title="Cannon Fodder" src="/images/reachstats/challenges/2.png" alt="Cannon Fodder" style="border-width:0px;">
<div class="info">
<div class="rFloat">
<p id="ctl00_mainContent_dailyChallengesRepeater_ctl02_challengeExpiration" class="timeDisplay dailyExpirationCountdown"><span>0d</span><span>19h</span><span>9m</span><span class="seconds">37s</span></p>
<p>1000cR</p>
</div>
<h5>Cannon Fodder</h5>
<p class="description">Kill 50 infantry-class foes in the Campaign today.</p>
<div class="reward">
<div id="ctl00_mainContent_dailyChallengesRepeater_ctl02_progressBox" class="barContainer">
<div id="ctl00_mainContent_dailyChallengesRepeater_ctl02_progressBar" class="bar" style="width:0%;"><span></span></div>
<p>0/50</p>
</div>
</div>
</div>
<div class="clear"></div>
</li>
<li>
<div class="corner topLeft"></div>
<img id="ctl00_mainContent_dailyChallengesRepeater_ctl03_challengeImage" title="Heroic Demon" src="/images/reachstats/challenges/3.png" alt="Heroic Demon" style="border-width:0px;">
<div class="info">
<div class="rFloat">
<p id="ctl00_mainContent_dailyChallengesRepeater_ctl03_challengeExpiration" class="timeDisplay dailyExpirationCountdown"><span>0d</span><span>19h</span><span>9m</span><span class="seconds">37s</span></p>
<p>1500cR</p>
</div>
<h5>Heroic Demon</h5>
<p class="description">Kill 30 Elites in Firefight Matchmaking on Heroic or harder.</p>
<div class="reward">
<div id="ctl00_mainContent_dailyChallengesRepeater_ctl03_progressBox" class="barContainer">
<div id="ctl00_mainContent_dailyChallengesRepeater_ctl03_progressBar" class="bar" style="width:0%;"><span></span></div>
<p>0/30</p>
</div>
</div>
</div>
<div class="clear"></div>
</li>
</ul>
The nutty part is, I cannot get Hpple to "see" the <div class="reward">. I'm using the following to find it:
NSArray * rawProgress = [doc search:#"//ul[#class='challengesList']
/li/div[#class='info']
/div[#class='reward']/p"];
This always returns an empty array. It's driving me nuts, as the same kind of thing worked for all of the other elements in this project...
Any help would be appreciated :)
EDIT
This works:
NSArray * rawDescriptions = [doc search:#"//ul[#class='challengesList']
/li/div[#class='info']
/p[#class='description']"];
This doesn't:
NSArray * rawProgress = [doc search:#"//ul[#class='challengesList']
/li/div[#class='info']
/div[#class='reward']
/div[#id]//p"];
Furthermore, trying to list the child nodes of rFloat or reward produces a crash :(
Your "p" element is not an immediate child of div class="reward".
Using XML you provided, XPath expression
div[#class='info']/div[#class='reward']//p
will work.
See this SO question for a similar report on problems with Hpple and a list of alternatives.
You may be seeing a bug. According to this page,
It's classified as an experimental
project by the developer, but so far
it's "worked for me"
UPDATE: seems to be kinda broken now.
Anyone got a better solution?
You may want to enter a bug report, and if the project is still being maintained, maybe the developer will respond with a fix or solution. Or you could leave a comment on this page that recommended hpple, and see if that blogger or one of his readers can address the problem or tell you if hpple is active at all.
You could also see if you can find HyperParser. "It's a simple HTML parser that has API similar to NSXMLParser. Designed specially to parse semi-valid HTML." But it doesn't seem to be there at the link where it used to be.