Log in

View Full Version : commenting out $block_data[latestentries]


doob
03-06-2014, 02:18 PM
I'm working with member profiles... but I'm sure other templates use $blocks

I want to hide some of the blocks, like $blocks[vistors] etc.

I don't see anything in the control panel to disable some of this stuff so I'm just hiding it in the templates, but I don't want to straight up delete it in case at some point I want to reintroduce the functionality.

So I'm commenting out the code, but this doesn't work <!--$block_data[latestentries]-->

Instead I need to do this <!--$--><!--block_data[latestentries]-->

The $ sign needs to be commented separately.

1) Am I making a workflow mistake by commenting code rather than looking for another way to manage the blocks.

2) Is there a better way to hide the code in the template without deleting it (i.e. a different comment system).

tbworld
03-06-2014, 02:30 PM
Use the <vb:comment> </vb:comment> tags. In most cases it will work better.
When using the HTML comment tags, best practice is to leave a space in the tag.

For example: <!-- $ -->

doob
03-06-2014, 02:34 PM
Isn't <vb:comment> </vb:comment> just for vbulletin 4 and higher?

tbworld
03-06-2014, 02:37 PM
Two other methods I use.

1.) Use CSS and temporarily hide the block from the device using "display: none". Of course the HTML is still sent to the user. Use this for a temporary measure as you do not have to alter the template to accomplish it.

2.) I create a special user account called 'adminview', then instead of using <vb:comment>, I use a regular conditional on the 'adminview' user account.

--------------- Added 06 Mar 2014 at 07:38 ---------------

Isn't <vb:comment> </vb:comment> just for vbulletin 4 and higher?

Oops! yep, sorry, I thought this was a VB4 question. :)

doob
03-06-2014, 02:47 PM
Thanks!