vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   commenting out $block_data[latestentries] (https://vborg.vbsupport.ru/showthread.php?t=309244)

doob 03-06-2014 02:18 PM

commenting out $block_data[latestentries]
 
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 ---------------

Quote:

Originally Posted by doob (Post 2485482)
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!


All times are GMT. The time now is 04:00 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01092 seconds
  • Memory Usage 1,717KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete