[ckan-dev] Different templates/css for different schemas?

Ian Ward ian at excess.org
Wed Oct 3 15:07:14 UTC 2018


CKAN passes a dataset_type variable to each template, you could override
the template you want and use a big if-else chain or something like {%
snippet '/my-theme/dataset-snippets/' + dataset_type + '.html' %} to
replace the page content you want.

On Wed, Oct 3, 2018 at 8:29 AM Neuvonen Samuli <samuli.neuvonen at ymparisto.fi>
wrote:

> Dear all,
>
> I'm quite new to CKAN so apologies if there is an easy and obvious way to
> solve this but:
>
> We are using the scheming extension (
> https://github.com/ckan/ckanext-scheming) for handling different dataset
> types in our CKAN. This works nicely but we would like to use completely
> different styling for some of them. As far as I understand, to do this we
> would need to have separate plugins for each schema-theme-combination,
> implementing the IConfigurer- and IDatasetForm-interfaces, and exclude
> these schemes/dataset types from the scheming extension? Or is there a
> better/easier way to do this? Can we somehow use the scheming extension as
> we do now but change the outlook of the web pages according to the dataset
> type? Is the currently selected package accessible in all the templates and
> if so, how?
>
> Thanks a lot,
> Samuli Neuvonen
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> https://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20181003/2bd85221/attachment-0002.html>


More information about the ckan-dev mailing list