<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://en.doc.boardgamearena.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Bartoleo</id>
	<title>Board Game Arena - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://en.doc.boardgamearena.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Bartoleo"/>
	<link rel="alternate" type="text/html" href="https://en.doc.boardgamearena.com/Special:Contributions/Bartoleo"/>
	<updated>2026-10-15T22:06:51Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.0</generator>
	<entry>
		<id>https://en.doc.boardgamearena.com/index.php?title=ExpandableSection&amp;diff=7592</id>
		<title>ExpandableSection</title>
		<link rel="alternate" type="text/html" href="https://en.doc.boardgamearena.com/index.php?title=ExpandableSection&amp;diff=7592"/>
		<updated>2021-03-09T16:08:09Z</updated>

		<summary type="html">&lt;p&gt;Bartoleo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Studio_Framework_Navigation}}&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
In &#039;&#039;&#039;&amp;lt;tt&amp;gt;mygame_mygame.tpl&amp;lt;/tt&amp;gt;&#039;&#039;&#039; (the border is not required):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;my_expandable&amp;quot; style=&amp;quot;border: 1px solid black&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;a href=&amp;quot;#&amp;quot; id=&amp;quot;my_click_to_toggle&amp;quot; class=&amp;quot;expandabletoggle expandablearrow&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;div class=&amp;quot;icon20&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
    &amp;lt;/a&amp;gt;&lt;br /&gt;
    &amp;lt;div id=&amp;quot;my_hidden_content&amp;quot; class=&amp;quot;expandablecontent&amp;quot;&amp;gt;&lt;br /&gt;
        Here&#039;s the hidden content&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In &#039;&#039;&#039;&amp;lt;tt&amp;gt;mygame.js&amp;lt;/tt&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
define([&lt;br /&gt;
    ebg/expandablesection&lt;br /&gt;
],&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
this.expanded = new ebg.expandablesection();&lt;br /&gt;
this.expanded.create(this, &amp;quot;my_expandable&amp;quot;);&lt;br /&gt;
this.expanded.expand();   // show&lt;br /&gt;
this.expanded.collapse(); // hide&lt;br /&gt;
this.expanded.toggle();   // switch show/hide&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Notes ===&lt;br /&gt;
* All of the inner parts of the expandable div must have ids so dojo.query can find them.&lt;br /&gt;
* The section already starts with click-to-toggle behavior, so you probably won&#039;t need to toggle in your own code. Just set the initial state in your setup method.&lt;br /&gt;
&lt;br /&gt;
== Helper Code ==&lt;br /&gt;
&lt;br /&gt;
This doesn&#039;t appear to be part of the BGA framework, but might make creating the above code easer and more readable.&lt;br /&gt;
&lt;br /&gt;
In &#039;&#039;&#039;&amp;lt;tt&amp;gt;mygame_mygame.tpl&amp;lt;/tt&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var jstpl_expandablesection = &#039;\&lt;br /&gt;
    &amp;lt;div id=&amp;quot;${id}&amp;quot;&amp;gt;\&lt;br /&gt;
        &amp;lt;a href=&amp;quot;#&amp;quot; id=&amp;quot;toggle_${id}&amp;quot; class=&amp;quot;expandabletoggle expandablearrow&amp;quot;&amp;gt;\&lt;br /&gt;
            &amp;lt;div class=&amp;quot;icon20&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;\&lt;br /&gt;
        &amp;lt;/a&amp;gt;\&lt;br /&gt;
        &amp;lt;div id=&amp;quot;content_${id}&amp;quot; class=&amp;quot;expandablecontent&amp;quot;&amp;gt;\&lt;br /&gt;
            ${content}\&lt;br /&gt;
        &amp;lt;/div&amp;gt;\&lt;br /&gt;
    &amp;lt;/div&amp;gt;&#039;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In &#039;&#039;&#039;&amp;lt;tt&amp;gt;mygame.js&amp;lt;/tt&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
placeExpandableSection: function(parent_id, id, content) {&lt;br /&gt;
   html = this.format_block(&#039;jstpl_expandablesection&#039;, { id: id, content: content }); &lt;br /&gt;
   dojo.place(html, parent_id);&lt;br /&gt;
},&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Bartoleo</name></author>
	</entry>
</feed>