Template:Startup/Funding entry/doc: Difference between revisions

No edit summary
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Description ==
== Description ==
This template defines a single row in the [[Template:Startup/Funding history table]].  
This template defines a single row in the [[Template:Startup/Funding history table]]. It is designed to handle Semantic MediaWiki (SMW) subobject creation intelligently, ensuring data is not duplicated when pages are transcluded.


It handles two tasks:
== Storage Logic: Subpage Only ==
# **Display:** Renders a table row with the Investor name and Round.
This template uses a conditional check to ensure Semantic Data is physically attached to the **Funding History Subpage**, while semantically linking back to the Main Startup Page.
# **Data Storage:** Stores a Semantic MediaWiki subobject with the funding details.


== ⚠️ Important: Subpage Logic ==
* **On Subpage:** When viewing `Startup Name/Funding_history`, the template detects the subpage context (via `{{#titleparts}}`) and **CREATES** the SMW subobjects.
To prevent duplicate data, this template includes a conditional check:
* **On Main Page:** When transcluded onto `Startup Name`, the template renders the visual table row but **SUPPRESSES** subobject creation to prevent "double counting" or duplicate database entries.
* It **only stores** the subobject if the page name ends in <code style="background:#eee">/Funding_history</code>.
* This allows you to transclude the Funding History table onto a main Startup page without creating a second, duplicate set of semantic data.


== Usage ==
== Usage ==
This template is usually called automatically by the generic [[Template:Startup/Funding history table]].
<pre>
<pre>
{{Startup/Funding entry
{{Startup/Funding entry
| investor = Sequoia
| investor = Sequoia Capital
| round = Series A
| round = Series A
}}
}}
</pre>
</pre>
== Parameters ==
{| class="wikitable"
! Parameter !! Description !! Type
|-
| '''investor''' || The name of the investor (e.g., Sequoia Capital). || Page Link
|-
| '''round''' || The funding round (e.g., Seed, Series A). || String
|}