Easy Template

6 messages Options
Embed this post
Permalink
difi80211g () Easy Template
Reply Threaded More More options
Print post
Permalink
I installed easy template on my Plone site, however I am unable to display the results I want.  I tried using the query that is listed on the product page:

{{ query({"portal_type":"News Item","sort_on":"Date","sort_order":"reverse","sort_limit":3,"review_state":"published"}) }}

but the only results I get are:

[<Products.ZCatalog.Catalog.mybrains object at 0x8329330>, <Products.ZCatalog.Catalog.mybrains object at 0x865d4e0>, <Products.ZCatalog.Catalog.mybrains object at 0x865dba0>]

I was told that I have to use a Jinja template to convert the catalog brains to HTML objects, however I can not find the documentation to do so.  I am trying to use the query above to list the 3 most recent news stories on my page.  

Can anyone shed some light on this situation for me?  Thank you.
Nathan Van Gheem () Re: Easy Template
Reply Threaded More More options
Print post
Permalink
[<Products.ZCatalog.Catalog.
mybrains object at 0x8329330>,
<Products.ZCatalog.Catalog.mybrains object at 0x865d4e0>,
<Products.ZCatalog.Catalog.mybrains object at 0x865dba0>]
Is just a list of brains.

So you'll have to figure out what the jinja way of doing a for loop in a template is and mix markup with it.  Then you access object information from it's brain.  For instance, these are some common things you might want,

brain.getURL
brain.Title
brain.Description

Good luck,
Nathan
 
2009/10/9 difi80211g <[hidden email]>

I installed easy template on my Plone site, however I am unable to display
the results I want.  I tried using the query that is listed on the product
page:

{{ query({"portal_type":"News
Item","sort_on":"Date","sort_order":"reverse","sort_limit":3,"review_state":"published"})
}}

but the only results I get are:

[<Products.ZCatalog.Catalog.mybrains object at 0x8329330>,
<Products.ZCatalog.Catalog.mybrains object at 0x865d4e0>,
<Products.ZCatalog.Catalog.mybrains object at 0x865dba0>]

I was told that I have to use a Jinja template to convert the catalog brains
to HTML objects, however I can not find the documentation to do so.  I am
trying to use the query above to list the 3 most recent news stories on my
page.

Can anyone shed some light on this situation for me?  Thank you.
--
View this message in context: http://n2.nabble.com/Easy-Template-tp3794092p3794092.html
Sent from the User Interface & Design mailing list archive at Nabble.com.

_______________________________________________
UI mailing list
[hidden email]
http://lists.plone.org/mailman/listinfo/ui


_______________________________________________
UI mailing list
[hidden email]
http://lists.plone.org/mailman/listinfo/ui
difi80211g () Re: Easy Template
Reply Threaded More More options
Print post
Permalink
OK, thank you for that piece.  Now i just need to find someone else that can help with the other part.  I can't seem to find the information online to make it work.


Nathan Van Gheem wrote:
>
> [<Products.ZCatalog.Catalog.
>>
>> mybrains object at 0x8329330>,
>> <Products.ZCatalog.Catalog.mybrains object at 0x865d4e0>,
>> <Products.ZCatalog.Catalog.mybrains object at 0x865dba0>]
>
> Is just a list of brains.

So you'll have to figure out what the jinja way of doing a for loop in a
template is and mix markup with it.  Then you access object information from
it's brain.  For instance, these are some common things you might want,

>
> brain.getURL
> brain.Title
> brain.Description
>

Good luck,
Nathan

2009/10/9 difi80211g <difioreg@casd.k12.pa.us>

>
> I installed easy template on my Plone site, however I am unable to display
> the results I want.  I tried using the query that is listed on the product
> page:
>
> {{ query({"portal_type":"News
>
> Item","sort_on":"Date","sort_order":"reverse","sort_limit":3,"review_state":"published"})
> }}
>
> but the only results I get are:
>
> [<Products.ZCatalog.Catalog.mybrains object at 0x8329330>,
> <Products.ZCatalog.Catalog.mybrains object at 0x865d4e0>,
> <Products.ZCatalog.Catalog.mybrains object at 0x865dba0>]
>
> I was told that I have to use a Jinja template to convert the catalog
> brains
> to HTML objects, however I can not find the documentation to do so.  I am
> trying to use the query above to list the 3 most recent news stories on my
> page.
>
> Can anyone shed some light on this situation for me?  Thank you.
> --
> View this message in context:
> http://n2.nabble.com/Easy-Template-tp3794092p3794092.html
> Sent from the User Interface & Design mailing list archive at Nabble.com.
>
> _______________________________________________
> UI mailing list
> UI@lists.plone.org
> http://lists.plone.org/mailman/listinfo/ui
>

_______________________________________________
UI mailing list
UI@lists.plone.org
http://lists.plone.org/mailman/listinfo/ui
Nathan Van Gheem () Re: Easy Template
Reply Threaded More More options
Print post
Permalink
Just look at the documentation for the templating engine.

google is your friend http://jinja.pocoo.org/2/documentation/



On Fri, Oct 9, 2009 at 11:47 PM, difi80211g <[hidden email]> wrote:

OK, thank you for that piece.  Now i just need to find someone else that can
help with the other part.  I can't seem to find the information online to
make it work.



Nathan Van Gheem wrote:
>
>>
>> [<Products.ZCatalog.Catalog.
>>>
>>> mybrains object at 0x8329330>,
>>> <Products.ZCatalog.Catalog.mybrains object at 0x865d4e0>,
>>> <Products.ZCatalog.Catalog.mybrains object at 0x865dba0>]
>>
>> Is just a list of brains.
>
> So you'll have to figure out what the jinja way of doing a for loop in a
> template is and mix markup with it.  Then you access object information
> from
> it's brain.  For instance, these are some common things you might want,
>
>>
>> brain.getURL
>> brain.Title
>> brain.Description
>>
>
> Good luck,
> Nathan
>
> 2009/10/9 difi80211g <[hidden email]>
>
>>
>> I installed easy template on my Plone site, however I am unable to
>> display
>> the results I want.  I tried using the query that is listed on the
>> product
>> page:
>>
>> {{ query({"portal_type":"News
>>
>> Item","sort_on":"Date","sort_order":"reverse","sort_limit":3,"review_state":"published"})
>> }}
>>
>> but the only results I get are:
>>
>> [<Products.ZCatalog.Catalog.mybrains object at 0x8329330>,
>> <Products.ZCatalog.Catalog.mybrains object at 0x865d4e0>,
>> <Products.ZCatalog.Catalog.mybrains object at 0x865dba0>]
>>
>> I was told that I have to use a Jinja template to convert the catalog
>> brains
>> to HTML objects, however I can not find the documentation to do so.  I am
>> trying to use the query above to list the 3 most recent news stories on
>> my
>> page.
>>
>> Can anyone shed some light on this situation for me?  Thank you.
>> --
>> View this message in context:
>> http://n2.nabble.com/Easy-Template-tp3794092p3794092.html
>> Sent from the User Interface & Design mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> UI mailing list
>> [hidden email]
>> http://lists.plone.org/mailman/listinfo/ui
>>
>
> _______________________________________________
> UI mailing list
> [hidden email]
> http://lists.plone.org/mailman/listinfo/ui
>
>

--
View this message in context: http://n2.nabble.com/Easy-Template-tp3794092p3797189.html
Sent from the User Interface & Design mailing list archive at Nabble.com.

_______________________________________________
UI mailing list
[hidden email]
http://lists.plone.org/mailman/listinfo/ui


_______________________________________________
UI mailing list
[hidden email]
http://lists.plone.org/mailman/listinfo/ui
difi80211g () Re: Easy Template
Reply Threaded More More options
Print post
Permalink
In reply to this post by difi80211g
I have everything working exactly the way I want now except for one thing.  Can anyone help with the property that will allow me to limit the query to a specific folder.  On the following statement i tried to add "path" : "/folder" among others but can not find the property to get it to search only a particular folder for News Items.  

{{ query({"portal_type":"News Item","sort_on":"Date","sort_order":"reverse","sort_limit":3,"review_state":"published"})  }}

Thanks again for the help.

difi80211g wrote:
OK, thank you for that piece.  Now i just need to find someone else that can help with the other part.  I can't seem to find the information online to make it work.


Nathan Van Gheem wrote:
>
> [<Products.ZCatalog.Catalog.
>>
>> mybrains object at 0x8329330>,
>> <Products.ZCatalog.Catalog.mybrains object at 0x865d4e0>,
>> <Products.ZCatalog.Catalog.mybrains object at 0x865dba0>]
>
> Is just a list of brains.

So you'll have to figure out what the jinja way of doing a for loop in a
template is and mix markup with it.  Then you access object information from
it's brain.  For instance, these are some common things you might want,

>
> brain.getURL
> brain.Title
> brain.Description
>

Good luck,
Nathan

2009/10/9 difi80211g <difioreg@casd.k12.pa.us>

>
> I installed easy template on my Plone site, however I am unable to display
> the results I want.  I tried using the query that is listed on the product
> page:
>
> {{ query({"portal_type":"News
>
> Item","sort_on":"Date","sort_order":"reverse","sort_limit":3,"review_state":"published"})
> }}
>
> but the only results I get are:
>
> [<Products.ZCatalog.Catalog.mybrains object at 0x8329330>,
> <Products.ZCatalog.Catalog.mybrains object at 0x865d4e0>,
> <Products.ZCatalog.Catalog.mybrains object at 0x865dba0>]
>
> I was told that I have to use a Jinja template to convert the catalog
> brains
> to HTML objects, however I can not find the documentation to do so.  I am
> trying to use the query above to list the 3 most recent news stories on my
> page.
>
> Can anyone shed some light on this situation for me?  Thank you.
> --
> View this message in context:
> http://n2.nabble.com/Easy-Template-tp3794092p3794092.html
> Sent from the User Interface & Design mailing list archive at Nabble.com.
>
> _______________________________________________
> UI mailing list
> UI@lists.plone.org
> http://lists.plone.org/mailman/listinfo/ui
>

_______________________________________________
UI mailing list
UI@lists.plone.org
http://lists.plone.org/mailman/listinfo/ui
Daner () Re: Easy Template
Reply Threaded More More options
Print post
Permalink
In reply to this post by Nathan Van Gheem
Thanks for that Google link!


Nathan Van Gheem wrote:
Just look at the documentation for the templating engine.

google is your friend http://jinja.pocoo.org/2/documentation/



On Fri, Oct 9, 2009 at 11:47 PM, difi80211g <difioreg@casd.k12.pa.us> wrote:

>
> OK, thank you for that piece.  Now i just need to find someone else that
> can
> help with the other part.  I can't seem to find the information online to
> make it work.
>
>
>
> Nathan Van Gheem wrote:
> >
> >>
> >> [<Products.ZCatalog.Catalog.
> >>>
> >>> mybrains object at 0x8329330>,
> >>> <Products.ZCatalog.Catalog.mybrains object at 0x865d4e0>,
> >>> <Products.ZCatalog.Catalog.mybrains object at 0x865dba0>]
> >>
> >> Is just a list of brains.
> >
> > So you'll have to figure out what the jinja way of doing a for loop in a
> > template is and mix markup with it.  Then you access object information
> > from
> > it's brain.  For instance, these are some common things you might want,
> >
> >>
> >> brain.getURL
> >> brain.Title
> >> brain.Description
> >>
> >
> > Good luck,
> > Nathan
> >
> > 2009/10/9 difi80211g <difioreg@casd.k12.pa.us>
> >
> >>
> >> I installed easy template on my Plone site, however I am unable to
> >> display
> >> the results I want.  I tried using the query that is listed on the
> >> product
> >> page:
> >>
> >> {{ query({"portal_type":"News
> >>
> >>
> Item","sort_on":"Date","sort_order":"reverse","sort_limit":3,"review_state":"published"})
> >> }}
> >>
> >> but the only results I get are:
> >>
> >> [<Products.ZCatalog.Catalog.mybrains object at 0x8329330>,
> >> <Products.ZCatalog.Catalog.mybrains object at 0x865d4e0>,
> >> <Products.ZCatalog.Catalog.mybrains object at 0x865dba0>]
> >>
> >> I was told that I have to use a Jinja template to convert the catalog
> >> brains
> >> to HTML objects, however I can not find the documentation to do so.  I
> am
> >> trying to use the query above to list the 3 most recent news stories on
> >> my
> >> page.
> >>
> >> Can anyone shed some light on this situation for me?  Thank you.
> >> --
> >> View this message in context:
> >> http://n2.nabble.com/Easy-Template-tp3794092p3794092.html
> >> Sent from the User Interface & Design mailing list archive at
> Nabble.com.
> >>
> >> _______________________________________________
> >> UI mailing list
> >> UI@lists.plone.org
> >> http://lists.plone.org/mailman/listinfo/ui
> >>
> >
> > _______________________________________________
> > UI mailing list
> > UI@lists.plone.org
> > http://lists.plone.org/mailman/listinfo/ui
> >
> >
>
> --
> View this message in context:
> http://n2.nabble.com/Easy-Template-tp3794092p3797189.html
> Sent from the User Interface & Design mailing list archive at Nabble.com.
>
> _______________________________________________
> UI mailing list
> UI@lists.plone.org
> http://lists.plone.org/mailman/listinfo/ui
>

_______________________________________________
UI mailing list
UI@lists.plone.org
http://lists.plone.org/mailman/listinfo/ui