Developer forum

Forum » CMS - Standard features » List ItemType pages with a property

List ItemType pages with a property

Adrian Ursu
Reply

Hi Guys,

I have this situation where I want to list all ItemType based pages witha specific value for a field.

Let's assume the Field is Product and The ItemType is ProductPage.

I want to list all ProductPages that have a value of XX in the field Product.

So far, my ideea is to use a sql query on the ItemType_ProductPage table and retrieve the ID for all lines that fulfill the condition above, then try to grab the Page link using somethink like GetPagebyItemID("ID"). I am not sure if such a function even exists or if it's a simpler way to acomplish my objective.

Any ideeas are welcomed.

Thanks,

Adrian

 


Replies

 
Nicolai Høeg Pedersen
Reply

Hi Adrian

Just use an item publisher - it has a filtering section where you can specify that you want items where field x has value y. See filtering here: http://manual.dynamicweb-cms.com/Dynamicweb-On-line-Manual/Items/Item-publisher.aspx

 
Adrian Ursu
Reply

Hi Nicolai,

Thanks for the reply.

I would avoid putting an ItemPublisher on each page becasue there are a lot of pages. I would like to do that from the template.

I know that Mikkel showed something about calling the ItemTypePublisher from the template but I am not sure if it also supports filters.

Thanks,

Adrian

 
Nicolai Høeg Pedersen
 
Adrian Ursu
Reply

Great!

Thanks a lot.
Adrian

 

You must be logged in to post in the forum