Announcement

Collapse
No announcement yet.

Creating a new template for widget use - Create plugin??

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Jacob_ITAPros
    replied
    Understood, I'll be sure to register the template as appropriate then. I take it this "caches" the template in the db for future use as opposed to making some sort of external call?

    Leave a comment:


  • Edwin Brown
    replied
    Properly pre-registering a template saves some time. Just for illustration, one database query and around .00008 seconds of CPU per template per page on our test server.

    Leave a comment:


  • Creating a new template for widget use - Create plugin??

    I've created a couple of templates that reference some css that I've put in additional, and it works fine for me. However, I was given an impression by a number of posts that many take the step of creating and activating a plugin with php code similar to this:

    Code:
    $myusername = $vbulletin->userinfo['username'];
    vB_Template::preRegister('vbcms_my_custom_widget_template',array('myusername' => $myusername));
    It doesn't appear that this is a necessary requirement to use custom templates for widgets, but I'm curious about why some perform this step? My only speculation is that this step is necessary if one were to desire using raw variables and such in their template???

Related Topics

Collapse

Working...
X