[ckan-dev] Modify home page template

Thodoris Papadopoulos thodoris at thodoris.net
Tue Mar 12 20:55:18 UTC 2013


Thanks Vitor!
I will look into that.

Thodoris



On Tue, Mar 12, 2013 at 10:28 PM, Vitor Baptista <vitor at vitorbaptista.com>wrote:

> Hi Thodoris,
>
> You'll have to overwrite the HomeController.index method, adding the
> result from ckan/logic/action/get.py's organization_list(). Then you can
> use that in the template...
>
> Cheers,
> Vítor.
>
> 2013/3/11 Thodoris Papadopoulos <thodoris at thodoris.net>
>
>>  Hi all,
>>
>> We are working with CKAN 2.0 beta , and we want to modify the home page
>> in order to display also the Organizations  (or the number of
>> organizations).
>>
>> I am trying to ovveride templates/home/index.html
>> and insert something like this (which is copied  from
>> templates/organizations/snippets/organization_list.html)
>>
>> {% for organization in *organizations* %}
>>         {% set first = loop.index0 % 3 == 0 %}
>>         {% set last  = loop.index0 % 3 == 2 %}
>>         {% snippet "organization/snippets/organization_item.html",
>> organization=organization, first=first, last=last %}
>>       {% endfor %}
>>
>> but of course it will not work since *organizations *is coming from
>> page.items of page templates/index.html.
>>
>>
>> Is there any documentation on how all this works ?
>> How can we query and then display organizations / datasets from home page
>> ?
>>
>> Regards,
>> Theodore
>>
>>
>> _______________________________________________
>> ckan-dev mailing list
>> ckan-dev at lists.okfn.org
>> http://lists.okfn.org/mailman/listinfo/ckan-dev
>> Unsubscribe: http://lists.okfn.org/mailman/options/ckan-dev
>>
>>
>
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> http://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: http://lists.okfn.org/mailman/options/ckan-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20130312/40d8f606/attachment-0001.html>


More information about the ckan-dev mailing list