BigCommerce Stencil CLI Blog - Conditions - bigcommerce

Is there any possible way to display blogs in BC from a certain count? For example, I want my top 3 most recent posts on the top of the blog page, but then beneath in a different format 4 onward would display. Anyway to start with the 4th blog down?

They are returned in most recent order, but you can limit the total to 7 in your example. I would then use Handlebar helpers in your Stencil theme to grab the first 3 for the top section and the next for for the last section. {{#for 1 3}}{{/for}} for the top section and {{#for 4 8}}{{/for}} for the bottom section

Related

Why cursor-based pagination in shopify ignores last page?

I'm using shopify api to get list of orders
For first request I use this URL:
https://my-shop-name.myshopify.com/admin/orders.json?status=any&order=created_at+desc&limit=250
and for all next use link to next page from response headers like described here:
Pagination with a link header
The problem is that last page or orders always gets ignored, because request for previous page doesn't contain link to next one.
That's weird, because it takes all orders from 4403 to 1153 (with 250 limit it's 13 pages) and it should make one more request (latest order number is 1101), to get latest 52 orders. Maybe the problem is in 250 limit parameter, but I don't know how to bypass it if I don't know exact number of orders

Rails 3 Kaminari fallback to first page if current page is out_of_range

I want to fallback to page 1 if the page number provided is out_of_range?.
For example if there are total 10 records and per_page is 5 which makes two pages. I want to fall back to page 1 if someone tries to hit page 3 which doesn't exist.
We are using kaminari (0.16.1).

Angellist api: How to get to second page of data?

I was looking at Angel list api (https://angel.co/api) and I noticed a section on pagination. It says entries are limited to max of 50 (for eg. https://api.angel.co/1/users/135/roles has 2 pages work of data but returns only 1 page). The documentation mentions pagination but does not say how to get 2nd page.
Any ideas?
Chetan
Add ?page=2 to the end of the request to get the second page.

Possible values for msrp_display_actual_price_type in Magento API

What are the possible values for msrp_display_actual_price_type in the Magento API. It takes an Int, but I haven't been able to find any documentation that tells what values are mapped to the UI, or how I might do a lookup to get those values.
A quick inspection of the admin panel and the field on a product edit screen, in the 'Prices' tab is 'Display Actual Price' and the values are:
1 = On Gesture
2 = In Cart
3 = Before Order Confirmation
4 = Use config
More information here: http://www.magentocommerce.com/api/rest/Resources/Products/products.html
I know this has been hanging around a while but I had the same questions, found this and then found the answer.
I encountered this error on CSV import which I resolved by replacing in the spreadsheet the msrp_display_actual_price_type value as follows:
Relaced: 4
with: Use config

How to detect a section in a wikimedia page dump

I have looked around quite a bit to try and answer this question, but to no avail. I am parsing wikimedia page dumps to process certain pages (yes, I am aware of several tools to parse wikimedia page dumps, but they don't work for me as well as my parser).
Question is simple. I know how to detect start of a section (e.g. "==External References=="). That's easy. What's not well defined is how to detect when a section ends? For example, for most sections I can scan until start of next section header, but that isn't reliable. I looked at wikimedia's help page on sections, but it doesn't say how to detect end of a section.
There is no "section end" marker in MediaWiki syntax. A section extends until the next section header of the same or lower level. (There is also a "section 0" containing all the text before the first section header.)
Yes, this implies that sections at different levels can overlap, as in this example:
This text is in section 0.
== Section 1 begins here ==
This text is in section 1.
=== Section 2 begins here ===
This text is in sections 1 and 2.
=== Section 3 begins here ===
This text is in sections 1 and 3.
== Section 4 begins here ==
This text is in section 4.
Note that headings created using the HTML <h1>, <h2>, etc. tags don't begin or end sections, and won't have section edit links, even though they look otherwise identical to section headings.
Section headings inside templates do get section edit links, which let you edit the corresponding section of the template, but they're treated specially and are not considered part of the normal section structure of the containing page. There are also some weird special cases here involving section headers inside template parameters which I don't fully remember off the top of my head.
The automatically generated first level heading at the top of every page also doesn't count as a section heading, although any extra first level headings created with = Heading = do.