@BenediktD wrote:
Hi,
I’m creating a small CMS with a Drupal backend (https://www.contentacms.org/) for Ember. In the backend I have a field to define a path for each page. I’m having trouble how to architect the routing in a bice way. I would like to avoid using page ID and just use the path defined in the backend.
this is a property I can access through my api as one string
/foo/bar/baz
.What I’m having trouble is defining my router so I can use the path defined in the api. It works when the slug is simply
/foo
or/bar
. But what do I do if the slug is/foo/bar
or just `/´ or any other length.This is what my router looks like currently.
Router.map(function() { this.route('page', { path: '/:path }); }
I’m also having trouble with the menu. How can I define a LinkTo helper that would work for any url length.
{{#link-to 'page' item.alias}}
only works for urls in the first level.Also I’m wondering how I would approach converting internal links that are used inside the body field with link-to helpers. I’m also having the same issue in the menu.
Posts: 1
Participants: 1