eZ Community » Forums » Discussions » For beginners: How to fetch olives...
expandshrink

Wednesday 09 February 2011 2:19:13 pm - 4 replies

» Read full blog post

Introduction

This blog post will show you how to fetch $handful of olives from $olivebranch_node_id in eZ Publish templates.

Friday 06 January 2012 3:52:51 pm

That's a really funny tutorial happy.gif Emoticon

Thanks for sharing,
Thomas.

Monday 09 January 2012 2:22:50 pm

Very usefull !

For beginners AND for experts !

Thanks

Monday 09 January 2012 11:22:54 pm

Is it me or are there no olives in that tree?

Tuesday 10 January 2012 8:00:39 am

Is it me or are there no olives in that tree?

 

Interesting comment to consider for too long in subtext ..

 

I think the example here is technically valid (if not suggestive ... re: photo chosen for this use case)

 

The code here is that which most of us are quite familiar but ...

 

See the results of the give example are what is being miss understood here not the visual representation of the example via the currently published photo.

 

Quite simply: Your looking at a valid example that produces results which are merely that of an empty result set blunk.gif Emoticon

 

Now this could be a code error, a usage error,
bad planning on either the planned action (fetch) or
the choice in location (picture or deeper still the choice
of a tree with no visible fruit (suggestive)) with which
to apply that action (this blog post, the entirety of the
example from another perspective). But consider further ...

 

@Steven At the end but at the end of the day ...
I think you might be right in your
 specific comment in this context.

 

But are we always in reality really fetching
the xyz or abc (insert your own noun here, mad lib style)
we should be in life?

I'm always saying 'results may vary' like I'm promoting
fred durst's latest album but it's true, you can't always
 expect results for an example to be valid ...

 

We can try any fetch but the results of a fetch are not guaranteed! So much like our own lives ...

Without the selection of the proper criteria (where to fetch, if you notice
his code example is unclear in this regard) .... perhaps he is merely fetching
in the wrong location in the content tree?
Perhaps this is a subtle hint from the author of the blog
 on a common problem for newer users regarding failed
 test results with expectations which in reality may not
 match the expectations of the user doing the testing
 (or in this case the reading). 

By showing a tree with no fruit any reader can clearly understand
the result set of the given example quite clearly.

Going back for a moment to the fetch in the example look
how narrow he searches in terms of depth of the content tree.
 Surely the developer fetching olives from a tree would know
that this action would require a greater depth than say fetching
a poison snack from a vending machine (ie depth of 4 produces
 more results than depth of 1, the default in usage where content
is not tied to a single level of a content tree node (storage strategies
 of multi level vs static single level). So this may or may not be
a valid comment (re: depth used in example) depending on what we
don't know about the content tree / content in general. Though more
 often than not trees seem to store results in subtrees more and more
commonly than in a single node at one level 

In fetching things from a physical tree, you often must use a depth
of greater than the default required say to fetch things from it's surface
than the depth required to fetch things deeper within the surface of the tree
(I don't know olive tree specs / usage here offhand, apologies). So the
depth required depends on the desired content's actual depth within the tree itself. 
Also worth pointing out the use of limit here is in this example unclear
since we can not know the limit in question the fetch could be silly like with a limit of 0 for example. I don't know I can't tell by the example what the limit might be blunk.gif Emoticon

Though as made clear in the photo, the depth or limit changed or left as the
default here, will prolly not change the results, as the tree clearly bears no fruit
(of the type being sought) ...

Is this subtext also a commentary of the use of the xyz system(s)
in a more suggestive and critical manner in full view to all but
understood by only limited few within the masses? Worth considering ...

 

Update: This post was written with a humorous intent. Your results reading it are predictably unpredictable try not to be offended :P Programmers pretending to be comedians ... results may vary blunk.gif Emoticon

 

//kracker

Theme song: Eben Moglen on the future of networking

Mirror: http://www.youtube.com/watch?v=pblfqJ7H7aI

Modified on Tuesday 10 January 2012 8:04:40 am by // kracker

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu