To give you an example, I have one magazine layout but the last page has to alter between a female advertisement and a male advertisement, depending on if the customer is male or female in the linked database. It would then output the magazine, with the correct advertisement on the last page, and continue until the database is complete.
Also, if anyone has any experience working with EFI Digital Storefront & DirectSmile, feel free to give me some advice.
You cannot switch entire pages on and off. The easiest way would be to somehow mark the variable pages, for instance with a unique master page. A script can then gather the page numbers to export, based on your requirements, and write them into the PDF Export dialog, and even - if you always use the same PDF Export Preset - directly create the PDF.
Don't know EFI Digital StoreFront but given that it seems you can use JS, what I would recommend here is to use specific layers for variable contents. I mean you could have a "male" layer and a "female" layer both hosting their respective contents. Then the script would display the specific layer given the record.
Of course it implies that either the script can read the database file (i.e. xml or csv file) or that EFI would provide the info to the script somehow.