logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Tycho  
#1 Posted : Tuesday, March 13, 2018 9:09:43 AM(UTC)
Tycho

Rank: Advanced Member

Groups: Registered
Joined: 11/19/2016(UTC)
Posts: 59
Man
Netherlands
Location: Leiden

Thanks: 6 times
Was thanked: 2 time(s) in 2 post(s)
I like to display a manufacturer logo on the product listview. Is there a token for that?
I used features-manufacturer to create a name and add the image to that.

Couldn't find the token on http://www.nbrightprojec.../Documentation/TagTokens but maybe I'm looking for the wrong word :-)

Cheers
Tycho
Tycho  
#2 Posted : Tuesday, March 13, 2018 9:31:33 AM(UTC)
Tycho

Rank: Advanced Member

Groups: Registered
Joined: 11/19/2016(UTC)
Posts: 59
Man
Netherlands
Location: Leiden

Thanks: 6 times
Was thanked: 2 time(s) in 2 post(s)
And I need the category image as well (for the header image).
I guess both are category images and somehow Nbright knows whether to display the cat image or one of the feature types...
leedavi  
#3 Posted : Tuesday, March 13, 2018 9:59:20 AM(UTC)
leedavi

Rank: Administration

Groups: Registered, Administrators
Joined: 11/6/2016(UTC)
Posts: 290
United Kingdom
Location: France

Was thanked: 27 time(s) in 27 post(s)
NOt sure what your question is? I assume you want to display a property image?

try PropertyValue token.

http://www.nbrightprojec.../Documentation/TagTokens

(P.S. Should be razortokens, tagtokens are the old system whcih is being phased out.)
thanks 1 user thanked leedavi for this useful post.
Tycho on 3/13/2018(UTC)
Tycho  
#4 Posted : Tuesday, March 13, 2018 12:24:17 PM(UTC)
Tycho

Rank: Advanced Member

Groups: Registered
Joined: 11/19/2016(UTC)
Posts: 59
Man
Netherlands
Location: Leiden

Thanks: 6 times
Was thanked: 2 time(s) in 2 post(s)
Ok, <img src='@(Category("imageurl", Model))' /> was enough to get the category image :-)
Tycho  
#5 Posted : Tuesday, March 13, 2018 12:52:18 PM(UTC)
Tycho

Rank: Advanced Member

Groups: Registered
Joined: 11/19/2016(UTC)
Posts: 59
Man
Netherlands
Location: Leiden

Thanks: 6 times
Was thanked: 2 time(s) in 2 post(s)
Last thing is to show a manufacturer image within the product list.

I figured that I need to have "man" to tell the template that the propertyref is manufacturer.

<div "manufacturerimg" style="width: @(Model.GetSettingInt("classicitemwidth") - 10)px; height: @(Model.GetSetting("classicitemimagecontainerheight"))">
<img src='@(PropertyValue("man", "imageurl"))' />
</div>

Assuming that @(PropertyValue is the right way to start, how dow I assign the right property value?
leedavi  
#6 Posted : Tuesday, March 13, 2018 2:18:00 PM(UTC)
leedavi

Rank: Administration

Groups: Registered, Administrators
Joined: 11/6/2016(UTC)
Posts: 290
United Kingdom
Location: France

Was thanked: 27 time(s) in 27 post(s)
That looks right, is it not working?
Tycho  
#7 Posted : Tuesday, March 13, 2018 3:15:16 PM(UTC)
Tycho

Rank: Advanced Member

Groups: Registered
Joined: 11/19/2016(UTC)
Posts: 59
Man
Netherlands
Location: Leiden

Thanks: 6 times
Was thanked: 2 time(s) in 2 post(s)
Nope, throws an error.
Tycho  
#8 Posted : Tuesday, March 13, 2018 3:25:44 PM(UTC)
Tycho

Rank: Advanced Member

Groups: Registered
Joined: 11/19/2016(UTC)
Posts: 59
Man
Netherlands
Location: Leiden

Thanks: 6 times
Was thanked: 2 time(s) in 2 post(s)
I skyped you the link, there you'll see the error.
leedavi  
#9 Posted : Tuesday, March 13, 2018 3:59:55 PM(UTC)
leedavi

Rank: Administration

Groups: Registered, Administrators
Joined: 11/6/2016(UTC)
Posts: 290
United Kingdom
Location: France

Was thanked: 27 time(s) in 27 post(s)
try something like htis....


// assign Model, so we can resolve var in VS
var product = (ProductData)Model.List.First();
var info = (NBrightInfo)product.Info;
var brand = PropertyValue(product, "man", "propertyname").ToString();
if (brand == "")
{
brand = info.GetXmlProperty("genxml/textbox/manufacturer");
}
Tycho  
#10 Posted : Tuesday, March 13, 2018 5:00:19 PM(UTC)
Tycho

Rank: Advanced Member

Groups: Registered
Joined: 11/19/2016(UTC)
Posts: 59
Man
Netherlands
Location: Leiden

Thanks: 6 times
Was thanked: 2 time(s) in 2 post(s)
<img src='@PropertyValue(product, "man", "imageurl").ToString()' />

Gives me an image. Yeah!
Styling looks crap but this is the most important step :-)

Thnx!
Tycho  
#11 Posted : Monday, March 26, 2018 7:48:29 PM(UTC)
Tycho

Rank: Advanced Member

Groups: Registered
Joined: 11/19/2016(UTC)
Posts: 59
Man
Netherlands
Location: Leiden

Thanks: 6 times
Was thanked: 2 time(s) in 2 post(s)
Hi Dave

As posted earlier: I got the manufacturer logo in the ProductList.
Next step"I like to add the supplier image to the ProductDetail page.

I expected that to be pretty straight forward, just change the feature ref.
So, just change "man" to "supp"

Which would give you:

<div class="supplierimage">
<img src='@PropertyValue(product, "supp", "imageurl").ToString()' />
</div>

But this doesn't work. It doesn't get loaded in the browser (debug mode is on)
leedavi  
#12 Posted : Tuesday, March 27, 2018 8:51:37 AM(UTC)
leedavi

Rank: Administration

Groups: Registered, Administrators
Joined: 11/6/2016(UTC)
Posts: 290
United Kingdom
Location: France

Was thanked: 27 time(s) in 27 post(s)
I take it you've created a property group called "supp"? or have you just craeted a property ref called "supp"?

if it's just a property with ref "supp" then you need:

<img src='@PropertyValue(product, "man", "imageurl", "supp").ToString()' />

Tycho  
#13 Posted : Tuesday, March 27, 2018 9:15:15 AM(UTC)
Tycho

Rank: Advanced Member

Groups: Registered
Joined: 11/19/2016(UTC)
Posts: 59
Man
Netherlands
Location: Leiden

Thanks: 6 times
Was thanked: 2 time(s) in 2 post(s)
I have a group type 'supp: supplier'
Within that group type there are several ref to suppliers so there is a supp name Glock banner (ref GLCK banner)
leedavi  
#14 Posted : Tuesday, March 27, 2018 9:18:46 AM(UTC)
leedavi

Rank: Administration

Groups: Registered, Administrators
Joined: 11/6/2016(UTC)
Posts: 290
United Kingdom
Location: France

Was thanked: 27 time(s) in 27 post(s)
OK, then your first format should have worked and picked up the first property attached to the product with a group od "supp"
leedavi  
#15 Posted : Tuesday, March 27, 2018 9:22:28 AM(UTC)
leedavi

Rank: Administration

Groups: Registered, Administrators
Joined: 11/6/2016(UTC)
Posts: 290
United Kingdom
Location: France

Was thanked: 27 time(s) in 27 post(s)
Just tested you code on my dev and it works. make sure you clear cache or put store into debug mode.
thanks 1 user thanked leedavi for this useful post.
Tycho on 3/28/2018(UTC)
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2018, Yet Another Forum.NET
This page was generated in 0.154 seconds.