Iterate over visible block
Permalink
Hi!
I'm sure this has been asked a lot in the past but i have no idea how I could search for that.
I have created a block type.
When i edit one of these the old one still remains in the database and a new one is created.
How do I iterate in a _JOB_ only over the ones that are shown or visible on the site?
Best regards and thx in advance
J. Fritsch
http://www.jfritsch.de
I'm sure this has been asked a lot in the past but i have no idea how I could search for that.
I have created a block type.
When i edit one of these the old one still remains in the database and a new one is created.
How do I iterate in a _JOB_ only over the ones that are shown or visible on the site?
Best regards and thx in advance
J. Fritsch
http://www.jfritsch.de
If you're using SQL statements, you need to join to the CollectionVersions and CollectionVersionBlock tables.
Look at the code in concrete/models/page.php -- in the getByID() function you'll see how it's done there (it also calls other models and functions, so follow the chain of calls to see the various queries involved).