[ckan-dev] Modify home page template

Vitor Baptista vitor at vitorbaptista.com
Wed Mar 13 16:49:56 UTC 2013


Hi Thodoris,

Correcting myself, don't use organization_list()  directly, but
logic.get_action('organization_list'). That method might be overridden by a
plugin, so getting it through get_action guarantees that you're using the
correct one.

Cheers,
Vitor.
On Mar 12, 2013 6:00 PM, "Thodoris Papadopoulos" <thodoris at thodoris.net>
wrote:

> 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
>>
>>
>
> _______________________________________________
> 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/20130313/8175514d/attachment-0001.html>


More information about the ckan-dev mailing list