Hello,
What is your getResource call ?
Hi Anso,
I thing this will not do want I want.
When I would put that e.g. in the HOME site. The Snippet will get me the age (in days) of the home site.
Ah yes... your snippet getDateDif is running on current doc (eg the home page in your case)
An other way would be to put getDateDif in your docs, store the value in a TV (ageOfDoc) and work with this TV ? Not the most direct way I guess, and not sure of its efficacity... I’m just thinking with you on how to solve this...
Hm...I think the problem is that the i/o filters and IF snippet dont work within a chunk using getResources.
I can get the date from a TV or from a snippet - It is equal. The problem with the IF or i/o filters will be still there.
Soooo. I am just getting freak out about Revo!!!
I found the solution for this problem.
I write like e.g. &then=`[[$chunkname]] and &else=`[[$chunkname2]] and we know that thing did not work.
So I just in case wrote not &then=`[[$chunkname]],
I worte &then=` <div....the complete chunk HTML incl. placeholder etc. `
The same withe the &else parameter.
So and this will work!!!
But why? And where I can read about that I can not use chunks in chunks or whatever?
-
☆ A M B ☆
- 24,524 Posts
You would have to actually somehow output the chunk tags. A snippet is PHP code; PHP doesn’t understand MODx tags. Doesn’t Revo have an equivalent to $modx->getChunk() and $modx->parseChunk()?