Posted on 23/04/2014 23:41:21
Hi Vladimir,
I think I am close, but not completely there yet. I have the following code:
using Dynamicweb.eCommerce.Products;
using Dynamicweb.Modules.ItemPublisher;
namespace Pc.Guru.Extenders
{
public class ProductTemplateExtender2 : ProductTemplateExtender
{
public override void ExtendTemplate(Dynamicweb.Rendering.Template template)
{
var value = this.Product.GetCategoryValue("Configurable_Servers", "Link_to_item");
if (value!=null)
{
var id = value.ToString().Split(new char[] {'='})[1]; // Contains something like 772, the ID of my item based page
var module = new Frontend();
template.SetTag("MyItem", module.GetContentBySettings("ItemType:Test2;ItemId:" + id + ";DetailsTemplate:/Templates/ItemPublisher/Details/Details.html;ItemFields:Name;"));
}
}
}
}
Test2 is the name of my item, I can also see that ID has a valid value for the item based page (that BTW does show up using a regular Item Publisher module). I also tried various paths to the templates (including your suggestion of ItemPublisher/Details/Details.html) but no matter what I try, the call to GetContentBySettings returns an empty string.
Any idea what I am doing wrong? I am testing this on DW 8.4.0.17
Thanks!
Imar