We report on a systematic procedure for the port-wise decomposition of electrical networks, which we refer to as the template-based approach. Our method exploits the SPQR-tree decomposition as an algorithmic procedure for decomposing a given circuit into a maximal set of one- and multiports. In particular, we provide a solution for representing subcircuits by suitable template graphs, such that they are encapsulated not decomposed/processed by the SPQR-algorithm. Contrary to current methods, our replacement graphs are not sophisticated but rather simple, which, in general, enhances the performance of the algorithm, when it comes to decomposing large electrical networks with multiports. Some electrical devices, such as transistors or op-amps, are commonly described in terms of their terminals rather than their ports. Thus, we cover the application of the template-based approach to three-terminal devices. Lastly, we discuss the advantages of the template-based SPQR-tree decomposition in the context of wave digital emulation.