{"id":20816070,"url":"https://github.com/arillo/meteor-flow-router-helpers","last_synced_at":"2025-05-07T12:40:49.193Z","repository":{"id":29206412,"uuid":"32737814","full_name":"arillo/meteor-flow-router-helpers","owner":"arillo","description":"Template helpers for meteorhacks:flow-router, pathFor, subsReady, urlFor, queryParam","archived":false,"fork":false,"pushed_at":"2017-11-08T18:13:13.000Z","size":30,"stargazers_count":127,"open_issues_count":9,"forks_count":23,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-31T10:04:44.117Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"CoffeeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arillo.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-23T14:40:56.000Z","updated_at":"2024-09-17T08:11:27.000Z","dependencies_parsed_at":"2022-08-17T19:55:08.969Z","dependency_job_id":null,"html_url":"https://github.com/arillo/meteor-flow-router-helpers","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arillo%2Fmeteor-flow-router-helpers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arillo%2Fmeteor-flow-router-helpers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arillo%2Fmeteor-flow-router-helpers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arillo%2Fmeteor-flow-router-helpers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arillo","download_url":"https://codeload.github.com/arillo/meteor-flow-router-helpers/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252879038,"owners_count":21818697,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-17T21:27:56.738Z","updated_at":"2025-05-07T12:40:49.163Z","avatar_url":"https://github.com/arillo.png","language":"CoffeeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Helpers for [FlowRouter](https://github.com/kadirahq/flow-router/)\n\n***THIS PROJECT IS DEPRECATING*** and not mantained anymore. If you are interested in mainting it just send us an e-mail.\n\nTemplate helpers for kadira:flow-router\n\n- subsReady\n- isSubReady (deprecated)\n- pathFor\n- urlFor\n- param\n- queryParam\n- currentRouteName\n- currentRouteOption\n\nContent blocks\n\n- linkTo\n\nSee [zimme:active-route](https://github.com/zimme/meteor-active-route) for using the following helpers\n\n- isActiveRoute\n- isActivePath\n- isNotActiveRoute\n- isNotActivePath\n\nOn the server it exports FlowRouterHelpers, with:\n\n- urlFor\n- pathFor\n\n### Install\n```sh\nmeteor add arillo:flow-router-helpers\n```\n\n### Demo\n[https://flowrouterhelpers.meteor.com](https://flowrouterhelpers.meteor.com)\n\n### Examples\n[https://github.com/arillo/meteor-flow-router-helpers-example](https://github.com/arillo/meteor-flow-router-helpers-example)\n\n### Usage subsReady\n\nIf you call subsReady without parameters it will check for all flow-router subscriptions to be ready. (It will not take into account the template level subscriptions you define)\n\nIf you pass parameters it will just check for this specific flow-router subscriptions to be ready. The parameters would be the subscription names you used when registering them on FlowRouter, like:\n\n```js\nFlowRouter.route('/posts', {\n    subscriptions: function(params, queryParams) {\n        this.register('posts', Meteor.subscribe('posts'));\n        this.register('items', Meteor.subscribe('items'));\n    }\n});\n```\n\n```handlebars\n{{#if subsReady 'items' 'posts'}}\n  \u003cul\u003e\n  {{#each items}}\n    \u003cli\u003e{{title}}\u003c/li\u003e\n  {{/each}}\n  \u003c/ul\u003e\n  \u003cul\u003e\n  {{#each posts}}\n    \u003cli\u003e{{title}}\u003c/li\u003e\n  {{/each}}\n  \u003c/ul\u003e\n{{/if}}\n```\n\n\n### Usage isSubReady (deprecated)\n\nChecks whether your subscription is ready. If you don't pass a subscription name it will check for all subscriptions.\n\n```handlebars\n{{#if isSubReady 'items'}}\n  \u003cul\u003e\n  {{#each items}}\n    \u003cli\u003e{{title}}\u003c/li\u003e\n  {{/each}}\n  \u003c/ul\u003e\n{{/if}}\n```\n\n### Usage pathFor\n\nUsed to build a path to your route. First parameter can be either the path definition or, since version 1.2.0 of flow-router, the name you assigned the route. After that you can pass the params needed to construct the path. Query parameters can be passed with the query parameter.\n\n__Notice:__ To deparameterize the query string we are currently using the not yet official accessor for the query lib in page.js via FlowRouter._qs\n\n```handlebars\n\u003ca href=\"{{pathFor '/post/:id' id=_id}}\"\u003eLink to post\u003c/a\u003e\n\u003ca href=\"{{pathFor 'postRouteName' id=_id}}\"\u003eLink to post\u003c/a\u003e\n\u003ca href=\"{{pathFor '/post/:id/comments/:cid' id=_id cid=comment._id}}\"\u003eLink to comment in post\u003c/a\u003e\n\u003ca href=\"{{pathFor '/post/:id/comments/:cid' id=_id cid=comment._id query='back=yes\u0026more=true'}}\"\u003eLink to comment in post with query params\u003c/a\u003e\n```\n\nServer side it can be used like this:\n```FlowRouterHelpers.pathFor('/post/:id',{ id:'12345' })```\n\n\n### Usage urlFor\n\nSame as pathFor, returns absolute URL.\n\n```handlebars\n{{urlFor '/post/:id' id=_id}}\n```\n\n### Usage linkTo\n\nCustom content block for creating a link\n\n```handlebars\n{{#linkTo '/posts/'}}\n  Go to posts\n{{/linkTo}}\n```\n\nwill return ```\u003ca href=\"/posts/\"\u003eGo to posts\u003c/a\u003e```\n\n### Usage param\n\nReturns the value for a url parameter\n\n```handlebars\n\u003cdiv\u003eID of this post is \u003cem\u003e{{param 'id'}}\u003c/em\u003e\u003c/div\u003e\n```\n\n### Usage queryParam\n\nReturns the value for a query parameter\n\n```handlebars\n\u003cinput placeholder=\"Search\" value=\"{{queryParam 'query'}}\"\u003e\n```\n\n### Usage currentRouteName\n\nReturns the name of the current route\n\n```handlebars\n\u003cdiv class={{currentRouteName}}\u003e\n  ...\n\u003c/div\u003e\n```\n### Usage currentRouteOption\n\nThis adds support to get options from flow router\n\n```javascript\nFlowRouter.route(\"name\", {\n  name: \"yourRouteName\",\n  action() {\n    BlazeLayout.render(\"layoutTemplate\", {main: \"main\"});\n  },\n  coolOption: \"coolOptionValue\"\n});\n```\n\n```handlebars\n\u003cdiv class={{currentRouteOption 'customRouteOption'}}\u003e\n  ...\n\u003c/div\u003e\n```\n\n## Changelog:\n    0.5.2 - Add currentRouteOption\n    0.5.0 - Add linkTo custom content block. Allow use of pathFor \u0026 urlFor on the server\n    0.4.6 - Add hashbang option to pathFor\n    0.4.4 - added currentRouteName helper\n    0.4.3 - added param helper\n    0.4.0 - updated to use kadira:flow-router\n    0.3.0 - changed isSubReady in favor of subsReady\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farillo%2Fmeteor-flow-router-helpers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farillo%2Fmeteor-flow-router-helpers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farillo%2Fmeteor-flow-router-helpers/lists"}