Tip: Getting a Side Bar on your Discussions page

May 2, 2012 at 2:27 AM

In case anyone are interested to get a side bar like on http://compositec1.codeplex.com/discussions page, here is how to hack it:

  1. do "Edit Discussion List Details" on your project discussion page,
  2. click the "html," button in the visual editor paste in the block below,
  3. customize js vars and content to your liking
  4. set "Display Behavior" to "<label class="radio_checked" for="ViewSelectionClassic">Show all discussions in one list</label>"

 

<!-- custom sidebar -->
<div id="CustomSidebar" style="float: right; display: block;">
  <div style="padding: 5px; background-color: #f0f1f4;">
    <p>
      <strong>Reporting an issue?</strong><br />Before reporting an issue, remember to (yada yada). If you have found a bug please create an issue in the <a href="/workitem/list/advanced?keyword=&amp;status=Open%2b%28not%2bclosed%29&amp;type=Issue&amp;priority=All&amp;release=All&amp;assignedTo=All&amp;component=All&amp;sortField=Votes&amp;sortDirection=Descending&amp;page=0">Issue Tracker</a>.
    </p>
    <p>
      <strong>Got a great feature idea?</strong><br />If you have a feature idea, consider also creating it in the <a href="/workitem/list/advanced?keyword=&amp;status=Open%20%28not%20closed%29&amp;type=Feature&amp;priority=All&amp;release=All&amp;assignedTo=All&amp;component=All&amp;sortField=Votes&amp;sortDirection=Descending&amp;page=0">Issue Tracker</a> with "Feature Request: (your idea)" as title, so we may vote it up.
    </p>
    <p>
      <strong>Rather use StackOverflow?</strong>
    </p>
    <p>
      <img style="width: 150px; float: left; margin-top: -7px;" src="http://blog.stackoverflow.com/wp-content/uploads/stackoverflow-logo-300.png" alt="StackOverflow logo" />
      <!-- stackoverflow w. tag -->
      <script type="text/javascript"> // <![CDATA[
        var stackoverflowTag = "composite-c1";
        document.write(' - <a href="http://stackoverflow.com/questions/ask?tags=' + stackoverflowTag + '">Ask a question</a> <br />  - <a href="http://stackoverflow.com/questions/tagged/' + stackoverflowTag + '">See answers</a>');
      // ]]>
      </script>
    </p>
  </div>
  <!-- facebook -->
  <script type="text/javascript">  // <![CDATA[
    var facebookPageUrl = "http://www.facebook.com/CompositeC1";
    document.write('<iframe scrolling="no" frameborder="0" allowtransparency="true"  style="border:none; overflow:hidden; width:320px; height:1200px; margin-top:10px;" src="http://www.facebook.com/plugins/likebox.php?href=' + encodeURIComponent(facebookPageUrl) + '&amp;width=280&amp;colorscheme=light&amp;show_faces=true&amp;border_color&amp;stream=true&amp;header=false&amp;height=940" ></iframe>');
  // ]]>
  </script>
  <!-- end custom sidebar -->
</div>
<div style="margin: 5px -10px 5px -10px; padding: 5px; background-color: #f0f1f4;">This forum is for everyone who have a question, problem or opinion related to (yada yada). See sidebar for details on how to better report errors and request features.</div>
<script type="text/javascript"> // <![CDATA[
	var customSidebar = document.getElementById("CustomSidebar");
	customSidebar.style.display = "none";
	
	function SetCustomSidebar() {
		document.getElementById("right_sidebar_noborder").appendChild(customSidebar);
		customSidebar.style.display = "block";
	}
	
	if (window.addEventListener) // W3C standard
	{
	  window.addEventListener('load', SetCustomSidebar, false); // NB **not** 'onload'
	} 
	else if (window.attachEvent) // Microsoft
	{
	  window.attachEvent('onload', SetCustomSidebar);
	}
// ]]>
</script>

 

 

May 3, 2012 at 12:24 AM

Hey folks,

This was a side effect of our new UI that we just released. Unfortunately, we've removed this ability as we did not intend to support the ability to insert arbitrary javascript into the discussion list details. We now strip out <script> tags. However, the outcome of what we saw you guys doing with this unintentional support was pretty cool, and we'll look into ways to allow project owners to better customize this and other aspects of their project with third party widgets in the future.

Jon

May 3, 2012 at 11:02 AM

love that censorship...

May 3, 2012 at 7:48 PM

The "rather use stackoverflow?" part is actually a good idea. It would be cool if you could just have the discussion tab forward you to somewhere else as a feature. I know some people use google groups or something like that instead also.