We need a bit more detail about the relationship(s) being used behind the portals.
- Are all of the documents in one related table? If so, you could filter the various portals by document type.
- Are groups of documents in different tables? If so, you will need a portal for each related table. If you want or need to, you could also filter copies of that realtionship/portal to show a narrower range of documents from each table.
- Some details of your relationships/diagram might help explain what you are attempting.
30 portals on a single screen seems overly-tight. If you are only intending to have one record in some portals, you can simply place the related field(s) without a portal, which will show the first related record via that relationship.
You mention scripting, but portals do not require scripting to display related records, unless you need to create the related records via a process, but that's really separate from the layout itself.
Thank you Stephen, I hadn't thought about filtering them individually based off document type. That cleared everything up