Snippet for TRACY DIC Container (edit ContainerPanel.panel.phtml) to add headings

Notice: This thread is very old.
andering
Member | 7
+
+1
-

I just wanted share this little snippet, which creates in DIC tracy window foldable headlines for services names divided by underscore or dot. If many services (what's seems to me usual), it makes easier to read/find.

Example

		<?php
			$category = preg_split( "/(\.|_)/", $name )[0];
			$category = is_numeric($category) ? "whatsmyname": $category;

			if($previous != $category){ ?>
				</tbody>
				<tbody>
				<tr>
					<td  style="background:#2c87f0;color:white;" colspan="4">
						<span data-tracy-ref="#<?php echo $category; ?>" class="tracy-toggle tracy-collapsed"><?php echo $category; ?></span>
					</td>
				</tr>
				</tbody>
				<tbody id="<?php echo $category; ?>" class="tracy-collapsed">
		<?php
				$previous = $category;
			} ?>