Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can you make a tag named paginate like shopiffy? #387

Closed
wuyonggang100 opened this issue Sep 13, 2021 · 8 comments
Closed

can you make a tag named paginate like shopiffy? #387

wuyonggang100 opened this issue Sep 13, 2021 · 8 comments
Labels

Comments

@wuyonggang100
Copy link

https://shopify.dev/api/liquid/objects/paginate
https://shopify.dev/api/liquid/tags/theme-tags#layout

@harttle
Copy link
Owner

harttle commented Sep 13, 2021

We do have a layout tag to make LiquidJS functionable out of the box. But other Shopify tags/filters will only be added into liquidjs if they're not Shopify business specific. Otherwise creating a plugin to maintain a given set of filgers/tags is recommended.

Feel free to open an issue for liquid support while doing so, or ask a question in LiquidJS Discussion.

@wuyonggang100
Copy link
Author

the question is how to get these variable like this in a plugin ?
import { assert, Tokenizer, evalToken, Emitter, TagToken, TopLevelToken, Context, Template, TagImplOptions, ParseStream } from '../../types'

@ericraio
Copy link

ericraio commented Oct 4, 2021

In ruby liquid, I was able to create the paginate block by inheriting from Liquid::Block. For liquidjs, I am trying to figure out how to accomplish the same thing and it looks like the necessary components are hidden away and not exported.

@harttle
Copy link
Owner

harttle commented Oct 4, 2021

@wuyonggang100 names in types.ts are exported by liquid.ts, can be obtained by importing liquidjs. Like:

import {TagToken} from 'liquidjs'

@harttle
Copy link
Owner

harttle commented Oct 4, 2021

@ericraio not sure what Block does. According to this doc, I suppose it's something like Tag or classes used by Tag. We do have registerTags and Drop, the latter one is not well documented but I believe it's usable.

@ericraio
Copy link

ericraio commented Oct 4, 2021 via email

@harttle
Copy link
Owner

harttle commented Oct 4, 2021

Seems like just Tag, implement something like if and register using registerTag will do the job.

@ericraio
Copy link

ericraio commented Oct 8, 2021

@harttle can tags perform iterations ? that's what shopify's block is doing

Repository owner locked and limited conversation to collaborators Oct 9, 2021
@harttle harttle closed this as completed Oct 9, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
Projects
None yet
Development

No branches or pull requests

3 participants