1

Topic: Error in documentation?

On this page:

http://www.wolfcms.org/wiki/functions:p … _parameter

Should this

"Thus, if a value is given for $level, it should be one of: null, equal-to-current-level, or greater-than-current-level. "

Not read

"Thus, if a value is given for $level, it should be one of: null, equal-to-current-level, or smaller-than-current-level. "

As the levels get smaller when I go to a parent?

::zielperson::

Thumbs up

2

Re: Error in documentation?

I am not sure if this is an error, but it is a little vague.

Take for example the Home page. While the Home page has the lowest level number (0) it is still the highest level in the page hierarchy.

I do agree however that this should be clarified to avoid any misunderstandings.

Looking for Wolf CMS plugins? See Wolf Pack, a plugin pack for Wolf CMS!

3

Re: Error in documentation?

Yes, it is the highest page, however, I think when talking about the numerical value (which is what we are giving here), it is right to say "smaller than" because, well, 0 is smaller than 1 or 2 or 3.

::zielperson::

Thumbs up

4

Re: Error in documentation?

The level() function returns an absolute number that is directly inverse to the hierarchical placement of the page and is based on the uri of the page. In other words:

Levels go from 0..N where 0 is the root page ("Home") and N is the lowest level of children.

Wolf CMS founder and lead developer
Please always check the Support forums and Wiki before asking. (My Ohloh account.)
Like Wolf CMS? Consider making a financial contribution or see our financial report first.

5

Re: Error in documentation?

Yes, exactly.

That is why the phrase in the documentation should be clarified.

::zielperson::

Thumbs up

6

Re: Error in documentation?

But you usually target $level > 0 or 1 etc. so it is greater than. Or is it only making sense to me neutral

Tutorials at Project 79 | Wolf CMS Docs

7

Re: Error in documentation?

Guys, we're having two discussions about essentially the same thing... Seems not very productive to me.

@zielperson, I agree the docs need to be clarified. I also agree the parent function WITH level argument does not work correctly. This is hopefully fixed in 0.8.0. (I'm planning a RC release soon)

http://www.wolfcms.org/forum/topic2158.html
http://www.wolfcms.org/forum/topic2159.html

Wolf CMS founder and lead developer
Please always check the Support forums and Wiki before asking. (My Ohloh account.)
Like Wolf CMS? Consider making a financial contribution or see our financial report first.