setting up a parallel route for slugs with a different template

13 views
Skip to first unread message

mic...@mozillafoundation.org

unread,
Jun 16, 2016, 3:20:04 AM6/16/16
to django CMS developers
Hey all,

I'm trying to figure out how to set up django-cms so that in addition to having urls for "domain:port/{lang}/{slugname}"resolve, rendering off of the principal page template, I can also access "domain:port/{lang}/partials/{slugname}", rendering using a different template. As use case, I'm trying to get content authored using django-cms, by slug, to generate only the HTML that the users created for consumption by external sources.

I had a look at the urls.py, which relies on cms.urls for its url matching, and was wondering whether there was an easy way to tell the cms section that I'd like a secondary route for slug content, to be rendered using a specific template from the templates dir.

Is this possible? And if not "out of the box", is it possible to manipulate django-cms/cms/urls.py in some way to effect the additional URL matching, and then set up template rendering using the secondary template file in another part of the cms codebase?

thanks,

- Mike "Pomax" Kamermans

Martin Koistinen

unread,
Jun 16, 2016, 7:20:53 PM6/16/16
to django CMS developers
There is an effort right now to implement an API on django CMS that would permit "exotic" frontends and/or mobile device apps, etc., to access specific objects through a RESTful api. I'm pretty sure, when complete, this would address your goal here. If you'd like to help out with the effort (would be great!), join us on our Slack channel:  #django-cms-api.
Reply all
Reply to author
Forward
0 new messages