Hiding blocks from the Table of Contents | XM Community
Skip to main content
Our team have a number of different surveys that we are trying to combine, and I would like to display these in a table of contents. However, several of these surveys involve multiple blocks, but I don't want all of these blocks to display individually on the TOC. Unfortunately, these blocks involve Loops & Merges so can't be combined into one (which would be the simplest solution to prevent them from displaying...)



Does anyone on here have a way of hiding specific blocks from the TOC? Perhaps based on the block names?



We could change the block names to include a specific phrase to easily identify which blocks to leave out, if this would be possible. I'm not familiar with java script or other coding languages to be able to write this, so would appreciate some help!





Someone else had written code to hide incomplete blocks - perhaps this could be adapted to hide blocks based on a different criteria instead?



<script type="text/javascript">

Qualtrics.SurveyEngine.addOnload(function()

{

if($('Toc')) {

$('Toc').select('.Incomplete').invoke('hide');

}

});

</script>



From: https://stackoverflow.com/questions/36190662/disabling-table-of-contents-links-in-qualtrics





Thanks in advance for your help!
Update: I've managed to hide majority of the blocks by using the code below:



<script>jQuery("#FL_4").hide();</script>



(Source: https://www.qualtrics.com/community/discussion/3326/in-qualtrics-table-of-contents-i-want-to-disable-the-checkmark-selectively-for-a-block-only)



FL_4 is the Flow ID of the block.



However, this code doesn't work for the blocks with Loop & Merge turned on. The problem has therefore changed slightly - how to adjust this code to hide blocks with Loop & Merge turned on?



Thanks again!
A team member managed to find the Flow ID for blocks with Loop & Merge turned on.



For future users: the flow IDs for these blocks are FL_L#. For instance, with the block mentioned above, the flow ID if Loop & Merge is turned on would be FL_L4.



The javascript to hide Loop & Merge blocks from the Table of Contents therefore becomes, e.g. for a block with Flow ID FL_4 (as it displays in the survey flow):



jQuery("#FL_L4").hide();



Hope that's helpful for others in the future.



##Update:

We added this code to the Look & Feel section of Qualtrics, in the 'General' tab. We included it under "Header", directly into the text box (without clicking "edit", which opens up an HTML editor so doesn't work). Make sure to add <script></script> around the javascript.

morodav - Were you able to find a solution for hiding blocks in the TOC with Loop&Merge turned on?


morodav Hi. When I put
jQuery("#FL_11").hide();
in the javascript section of the first intro page(block), it doesn't work. I am trying to hide multiple block and I am adding the jquery to hide the flow in the onload function.
You put the js code in look and feel section but I want to hide the block dynamically and thus my requirement is to hide it from js code in the starting block.
Do you think this code will work only we put it under look and feel section ?



Leave a Reply