I need to know if there are any posts so that I can insert other html. For example, if I have vacancies (using posts with the tag vacancy) I will simply iterate through the posts – no big deal there. However if there are no posts found by tag vacancy, then I want to insert a blurb that there are no vacancies at this point.
I noticed that if no posts are found using getPostsByTags the entire block is skipped. There is no logic I can use in this case within the block. Is there an other way to know?
Is there a way to test if the getPostsByTags helper returns true or false? Maybe I could use a pre-test before calling getPostsByTags again.
I tried @index == ‘0’ (zero) and found that within a getPostsByTags block where there are posts found, this would indicate the first post. I might be able to use this to answer the question below. I did find that once the getPostsByTags block has iterated through all of the posts level is undefined.
As well, before I iterate through the posts, I need to insert some divs to setup the structure. I see unless level used in other places such as in a menu, can I use unless level within a getPostsByTags block?
It would be nice if you could document level as used within unless and I assume checkif.
Mean while I am still looking for a solution.
Cheers!!