Developer forum

Forum » Templates » Item property is not passing from page/paragraph to include

Item property is not passing from page/paragraph to include

Dmitrij Jazel
Reply

Hi guys,

Not sure if anyone eve noticed but I have an issue here. This is what I did.

1) Created an item page called Shopping cart of item type ("Shopping cart").

2) Added paragraph, and attached module to it with Cart.

3) In the ShowCart.cshtml template - I am using @IncludeFile("../includes/helper.cshtml") 

My issue is that - while I am in the "helper.cshtml" file, I am unable to reach any of the peoperties I have on my page item "Shopping cart" item type.

 

Than thought of work arround - I created a type for a paragraph - with properties that page would have to have. And attempted to reach those - but still the same issue.

To my surprise none of the Item values set are send further. While you are in include template of a module template, asigned by the module in a paragraph.

Any suggestions?

/Dmitrij


Replies

 
Dmitrij Jazel
Reply

In addition to that, noticed that if I have some nordic characters in my @Translate("my translation"), in same../includes/helper.cshtml file 

It will return something like this: http://screencast.com/t/YhXzvG4zw9M a black diamond with questionmark.

Any way to avoid this?

/Dmitrij

 
Nicolai Høeg Pedersen
Reply

Hi Dmitrij

When you use Include, all we do is merge the 2 files before compile - so it is a scope problem in your code. Try including the content of the file directly and fix your issue there.

The weird characters could be that your cshtml file is not saved as utf-8. In VS, choose "save as" and set the encoding.

 

You must be logged in to post in the forum