Developer forum

Forum » CMS - Standard features » Item publisher : data source for Items

Item publisher : data source for Items

Gaetan Di Caro
Reply

Hello,

I'm very new to Dynamic Web so forgive me if my question seems obvious. I have been reading the documentation and fumbling around for a while and I can't find an answer.

I have created an item type representing a person with some plain information, then another type, a Person List, which contains a list of persons plus a department name. I am trying to set up an URL returning JSON containing the list corresponding to a department in particular. I have written the HTML template for that and I think I've gotten around the basics so this part should be ok. However I'm having difficulties finding where should the values come from. All the information concerning the persons and the departments should come from Dynamic Web, but I have no idea how and where to create objects of a given item type.

I have tried to create a paragraph based on an html template for my Person List. If I add one or more to another page, I can populate it with data, which then shows up accordingly. I have therefore tried to use the "Select specific items" in the item publisher, and I have selected my paragraphs. But still no data in my json, and I'm not sure if this is the right way anyway.

 

Thanks !


Replies

 
Gaetan Di Caro
Reply

Ok nevermind, I found out how to do it :)

I guess "Select specific items" looks INSIDE the items I selected. If I choose "Select item from the current language/area" and tick the checkbox about paragraphs it works.

 
Gaetan Di Caro
Reply

This said, I still have a question : if I want Item data coming from dynamic web, is creating pages/paragraphs the right way to do it ? Or is there a more abstract, database-like way ?

 

Thanks !

 
Nicolai Høeg Pedersen
Reply

Hi Gaetan

You can use named item lists which you can find on the pages properties, see dump.

BR Nicolai

Capture.JPG
 
Gaetan Di Caro
Reply

Thanks Nicolai, seems like that's what I'm looking for. However I have another problem.

Currently I have 2 item types :

-Person (which contains some data)

-PersonList (which contains a list of persons + some info on this list)

Since I need to have a list of Persons in PersonList, I enabled Person for ItemList.

The named lists feature you showed me only allows list of items which have been enables for ItemList, so it only shows the type "Person". However, I cannot enable PersonList for ItemList, I get this error : "The item type contains item list fields. It is not allowed to use item list fields for item lists. Deselect Item List in the Item type settings."

Do you have any solution ?

 

Thank you !

 
Nicolai Høeg Pedersen
Reply

Hi Gaetan

You should be able to do that. What version are you on.

See my example in the dump. Have a carousel with a list of carousel images. The caruousel can be marked for item lists...

Capture.JPG
 
Gaetan Di Caro
Reply

I'm using 8.6.1.0

 
Nicolai Høeg Pedersen
Reply

That should work.

Can you provide a link?

 
Gaetan Di Caro
Reply

Unfortunately no, I'm working on a local copy. I attached two screenshots of a test I made, to be sure it wasn't something to do with my items.

2015-04-17_09_53_51-Dynamicweb_8_-_Dynamicweb_Administration.png 2015-04-17_09_54_33-Dynamicweb_8_-_Dynamicweb_Administration.png
 
Nicolai Høeg Pedersen
Reply

Hi Gaetan

Try removing the field with the list, set the setting, and then add the field again...

 
Gaetan Di Caro
Reply

Sorry, still not. When I delete the field, then set the setting, I can add a list of items, but then the error appears when I try to save the item.

 
Nicolai Høeg Pedersen
Reply
This post has been marked as an answer

Not easy!

Lets try this trick: In /Files/System/Items there is an XML document with the item type definition. Remove the field, set the checkbox, save the item type and find the XML documentation. You can then find in the XML what defines this setting.

Then add the list field again, remove the checkbox, open the XML again and add the setting directly in the XML. That might work! A hack, I know!

Votes for this answer: 1
 
Gaetan Di Caro
Reply

It does work, thanks !

 
Gaetan Di Caro
Reply

Hello,

I still have the problem after upgrading to v.8.6.1.11. Is it scheduled to be fixed ?

Thanks !

 
Gaetan Di Caro
Reply

Also, it seems to be posing a problem : when I put 2 item lists of the same item type, only the first one is shown in the item editor of the named item list. I have created a bug case about it but since it's a bug caused by a hack it was closed.

 
Gaetan Di Caro
Reply

After a bit of research and tests, it is not because there are more than 2 item lists of the same type. First, I tried to put several item lists of the same type in another item type, and it worked. Secondly, in my item type, if I add ANY new item list of ANY type (at any position), it doesn't show in the item list editor. It DOES appear as a column for the list of the items, but when I click on an item to edit it, it's not there. It seems to be a problem with this item type in particular. I attached the xml of my item type.

Here is my bug case number : 11209

Any idea ?

 

Thanks !

 
Nicolai Høeg Pedersen
Reply

Could be the + sign in your Layout field - one of the options.

Try to see if you get any JS errors in your browser console when editing this item type.

 
Gaetan Di Caro
Reply

I tried to remove the + sign but it didn't fix it. I do get some Javascript errors though, I attached a screenshot of what's happening when I select the item list then click to edit an item.

 

Thank you !

2015-08-10_08_28_30-Dynamicweb_8_-_Dynamicweb_Administration.png
 
Nicolai Høeg Pedersen
Reply

Hi

It could be a problem with your Visual Studio using Browser link. Try disabling it: http://www.asp.net/visual-studio/overview/2013/using-browser-link

 
Gaetan Di Caro
Reply

Sorry, no luck either :/

 
Nicolai Høeg Pedersen
Reply

There is a bug against the issue on your case, 112290, the bug number is TFS#17959

 
Gaetan Di Caro
Reply

Alright, thank you. I look forward to a fix :)

 

You must be logged in to post in the forum