liquidjs icon indicating copy to clipboard operation
liquidjs copied to clipboard

Section tag: Feature Request

Open leighs-hammer opened this issue 6 years ago • 9 comments

Hi Not an issue more of a feature request, would be good to add the base tag {% section "fName" %}

Looking at the include tag code, it looks like it would pretty much mirror that. I may spool up and test a pr duplicating the include tag implementation :)

leighs-hammer avatar Mar 28 '19 15:03 leighs-hammer

Is section an official tag? Can you make a reference to the liquid documentation?

harttle avatar Mar 29 '19 03:03 harttle

Hiya, not an official as far as liquid goes. However an official tag on shopify liquid rendering so thought in context to :

A shopify compatible Liquid template engine in pure JavaScript.

as in if some one wanted to render some existing Shopify code via node It would hit a number of missing Shopify specific tags.

  • section ( include with specific capabilities )

Ones that wouldn't make sense to add as individuals may wish to write logic around these:

  • schema / endschema
  • form / endform
  • paginate / endpaginate ...

I am not sure on the scope you are trying to work to, but if it is to render shopify templates via node ( my use case ), there will be these implementations that do not exist in the liquid docs.

At present I am just gonna build them into a plugin for usage in my use case. :)

leighs-hammer avatar Mar 29 '19 12:03 leighs-hammer

That's great to have this plugin, I would like to put it into the plugin list when you're ready.

harttle avatar Mar 29 '19 15:03 harttle

Any update on this issue?

jamelait avatar May 29 '19 13:05 jamelait

I tried to make a section-tags plugin but I just find out that I'm totally not familiar with shopify sections. Anyway it could be a start point, sharing my code here: https://github.com/harttle/liquidjs-section-tags .

Since this repo only support standard filters and tags given by shopify/liquid, this thread should be closed.

harttle avatar Jul 21 '19 17:07 harttle

@harttle what's the latest on this?

jsuiker avatar Dec 01 '23 20:12 jsuiker

The above mentioned repo is discontinued. But I think we should keep this issue open as people are still interested.

Let’s wait for the implementation here.

harttle avatar Dec 02 '23 14:12 harttle

@harttle anything I can do? If you have time to get me up to speed I can dig in and get it working.

jsuiker avatar Dec 02 '23 14:12 jsuiker

I've transfered harttle/liquidjs-section-tags to you. Hope that can still run with latest LiquidJS, otherwise please check the migration guide.

These links are also useful:

  • https://liquidjs.com/tutorials/plugins.html
  • https://liquidjs.com/tutorials/register-filters-tags.html

Feel free to ask any further questions on discussions page, as dev questions are also valid there, many people trying to implement their own tags/filters, others can also help you.

My problem is not familiar with how section works. Please ask for help when get stuck on LiquidJS problems, I can create PRs to fix them.

harttle avatar Dec 02 '23 14:12 harttle

Again, closing as there's no section/theme concept in LiquidJS as a general-purpose template engine. Feel free to contact me if someone have a decent implemention that I can link to in LiquidJS docs.

harttle avatar Jun 27 '24 17:06 harttle