I am trying to render a particular Dreamweaver component template. can anyone help me with the script to display a particular component presentation.
You can use the following built in function if you know the Component and Component Template ID
RenderComponentPresentation(string componentUri, string templateUri)
Your DWT syntax would look like
However, be careful moving between environments as these ID's will change.
Assuming you want to render a component presentation on a PT.
To render a component presentation selectively, you need a way to identify it. If you want to do it based on the component title, you can do it like below:
<!-- TemplateBeginRepeat name="Components" --> <!-- TemplateBeginIf cond="Component.Title == '[Insert Component Title]'" --> @@RenderComponentPresentation()@@ <!-- TemplateEndIf --> <!-- TemplateEndRepeat -->
Read more about the Dreamweaver Templating here
If you want to render all components using a given template you can use Will Price's Group Components By Template Type TBB found here: https://sdltridionworld.com/community/2011_extensions/generic-2011-tbbs.aspx
This will group all components using the same templates onto an array on your package which you can iterate over using:
<!-- TemplateBeginIf cond="[Insert Template Name]Components" --> <!-- TemplateBeginRepeat name="[Insert Template Name]Components" --> @@RenderComponentPresentation()@@ <!-- TemplateEndRepeat --> <!-- TemplateEndIf -->
Will's code is well commented and includes more details on how it can be used.