Is it possible to mix modular templates and legacy VBScript CT?

In particular, I mean the following:

@@RenderComponentPresentation(Component, "<vbs-legacy-ct-tcm-uri>")@@ 

The problem I am facing is that in my case the VBS code breaks when it tries to access the component fields, giving "Error 13 type of mismatch".

(So, if I gave an answer, I would say: "Partially, practical use")

EDIT DWT above refers to another CT, so this is a component link rendering efficiently, so taskless overloading as suggested by Nuno will not work, unfortunately. BTW, the following lines inside VBS are not interrupted and give the correct values:

 WriteOut Component.ID WriteOut Component.Schema.Title 

EDIT 2

Dominic was absolutely right: these are the missing dependencies.

A little more information to make this information useful:

Suppose the original CT looked like this (type VBScript [Legacy] ":

 [% Call RenderComponent(Component) %] 

This CT scan was to be called from the PT, as well as based on VBS. This PT had a large chunk of "#include" instructions at the beginning.

Now the story is changing: the same CT is called from another, based on DWT, CT. Obviously (thank you for your invaluable help!), Dependencies are no longer included anywhere.

The decision to do the original CT job again is to explicitly manually select and enable all the necessary TBBS VBS, so the original CT becomes:

 [% #include "tcm:<uri-of-vbs-tbb>" Call RenderComponent(Component) %] 
+6
source share
3 answers

Yes - it’s entirely possible to mix and match obsolete and modular templates. Perhaps it’s obvious that you cannot mix and match template building blocks between two methods.

In VBScript, “Error 13 Type Mismatch” is sometimes used as a secret code, which really means “I do not recognize the name of one of your variables (including the names of functions and subscriptions).” In the VBScript template engine, variables from the page template may be in the area of ​​your component template ; it was very common, for example, to put #includes in PT so that they could be used by CT. I assume that your component template is trying to use such a function and cannot find it.

+5
source

I know that you can display a modular page template with presentations of VBScript components, and also a VbScript page template can display a modular component template.

Perhaps your mistake is related to something else? Have you tried just using the regular call @@RenderComponentPresentation()@@ without specifying which template?

+4
source

The page template can display complex templates of different tastes - for example, Razor, VBS or XSLT.

The problem arises from the TBBs included in the Templates. Often, Razor templates need to call functions that exist only in VBScript. So, the starting point for the transition of templates always begins with auxiliary functions and utility libraries. Then transfer the most common PT / CT that you have into the new format (Razor, XSLT, DWT, etc.). This provides a good basis for migrating the rest of the templates, since you have time for the new format.

+2
source

All Articles