Developer forum

Forum » Ecommerce - Standard features » Smart Search with value from Item field

Smart Search with value from Item field

Adrian Ursu
Reply

Hi Guys,

I am trying to define a page for Brands. A page that will display all prodycts from a Brand but without the ugly URL. my aim is to have something like http://mydomain.com/brand

I have tried several options so far and the one that seems apeealing is the combination of ItemType based Page and Smart Search for each Brand.

The SmartSearch will have a filter on Brand that is supposed to get the value from the Item Page. I have seen some usage examples reading values from Product (for example @Product(ID)).  (http://manual.dynamicweb-cms.com/Dynamicweb-eCommerce/Smart-searches.aspx) 

I was wondering if it would be possible to get the value from an Item, Like @Item(Field_Name).

Is it daydreaming?

Anyone has a better approach?

Thanks,

Adrian


Replies

 
Nicolai Høeg Pedersen
Reply

Hi Adrian

You cannot use @item. You can use a regular search using the new index - place the product catalog and overwrite the default value for the brand parameter.

An alterntive, if you are using DW manufacturers, is to use the manufacturer url provider, see dump. It will convert /page/nike.aspx to default.aspx?id=12&ManufacturerID=Manu1

BR Nicolai

Capture.PNG
 
Adrian Ursu
Reply

Hi Nicolai,

Thank you for the suggestion.

I cannot use manufacturers because I have several Brands attached to a Manufacturer. I will see if I can convince the client to drop Manufacturer and keep only brands. in this case Manufacturer navigation should work just fine.

Is there any chance I can take something from Page Properties? Say, my page name is <Brand_Name> I would access @Page(Title).

Surely, the new index makes more sense for this but I will still need to pass the value from the ItemField to the IndexQuery

 

Thanks,

Adrian

 
Nicolai Høeg Pedersen
Reply

Hi Adrian

You can try this as a parameter:

@Code(Dynamicweb.Frontend.PageView.Current().Page.Item["fieldname"].ToString())

or

@Code(Dynamicweb.Frontend.PageView.Current().Page.PropertyItem["fieldname"].ToString())

BR Nicolai

 
Adrian Ursu
Reply

Thanks a lot.

I will try and get back to you with the result.

Thanks,
Adrian

 
Adrian Ursu
Reply

Tested. Could not make it work.
I tried that code in both Index query (as default value) and in SmartSearch.

I tried to see if the code returns anything if put in page and it actually returned an error. Something about Null.

I also tried @Pageview.Page.PropertyItem["Name"] that actually returns the correct value if displayed in page but nothing if used with @Code() in either smart search or IndexQuery

 

You must be logged in to post in the forum