Closed murwiz closed 9 years ago
I was inspired to look in the *.t files for some of this functionality, and I realized my error: <container>
is more of a declarative thing than a nestable structure. Ignore this for now; I'll revisit it if my new knowledge doesn't get me un-stuck.
I suppose you could use nested lists for this purpose.
Nope, that* didn't solve my problem. I need to look at some more complex examples of specifications and templates; if you can point me to some, that might be all I need. If not, I'll have to send you what I have in hopes you can see where I'm going wrong.
*By which I mean, what I was alluding to, not your nested-list suggestion. I am not sure how a nested list would help.
This is still an issue for me. Specifically this rather common case:
I am displaying a list of products with a <list iterator="products">. Within that, I need to display one of two chunks of HTML based on whether the product can be ordered from within that list page, or if you must click to the flypage to order it. (Because the product has complex options, or variants, which discourages a simple add-to-cart button among the list of products.)
I can boil down the decision to a method on a $product, and thus define this container:
<container name="can_purchase" value="is_canonical&!has_variants"/> <container name="cannot_purchase" value="!is_canonical&|has_variants"/>
However, at the level of the list item, the container does not seem to be using the current product in each row.
Corrected markup for readability.
Please test this again with the upcoming 0.0150 release.
No feedback, thus closing the issue.
I'm attempting to create a "report-break" product listing, e.g.,
Product Group Name -- Category Name Product #1 Product #2 Product #3 -- Another Category Name Product #4 Product #5
Another Product Group Name etc. (The line breaks in the above are strictly for clarity.)
My approach was to define a
<list>
to show one product, with an optional "break" displayed based on the context of the current iterator item. So my specification looks like this:`
`
My question is, can a
<container>
exist within a<list>
, and if so, what are the rules for referencing the iterator item? Should these<container>
tags have<param>
within them?