Developer forum

Forum » CMS - Standard features » Complex item creator - best approach

Complex item creator - best approach

Nuno Aguiar
Reply

Hi,

 

We have a project where we need to dynamically create the following item structure in the frontend:

  • Case X
    • Box A
      • prod_Item 1
      • prod_Item 2
      • prod_Item 3
    • Box B
      • prod_Item 4
      • prod_Item 5
    • Box C
      • prod_Item 6
      • prod_Item 7
      • prod_Item 8

 

Ideally a Case would be an Item (within a named item list [we expect hundreds per month plus the ability to search is important]), Boxes would be an itemlist associated with a Case and prod_Items as an item list within Boxes, but that't not possible in the current Dynamicweb version.

 

Considering http://developer.dynamicweb.com/forum.aspx?PID=48&ThreadID=40383 we figured out that we create "Cases" with the Item Creator and redirect them to another page with the Item creator, where we create the "Boxes", and then redirect them to another page to create the "prod_Items". Reasons:

  • Each case may have multiple boxes and each box may have multiple prod_items
  • We cannot create item lists within an item using the item creator (current DW version)
  • Since we cannot have item lists within items lists, "Cases" are pages, "Boxes" are pages and "prod_Items" are paragraphs

 

We made it work by manually inserting a paragraph (in SQL) with the item creator module on every new page (Case and Boxes), but that does not seem a very good approach since we need to develop something to clean that paragraph after everything is done.

 

One thing I also though was what if we could do RenderParagraphContent and override the module's settings (check attachment) to dynamically set the Target page, but don't know how/if it is possible. That way we could avoid creating a paragraph with the item creator module on evey new Case/Box.

 

Any help/guidance is appreciatted. Right now I just need a suggestion on what the best path should be (maybe even considering future updates of Dynamicweb where we could do some SQL queries to update the data).

 

Best Regards,

Nuno Aguiar

ItemCreator.jpg

Replies

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

Hi Nuno

In my opinion this scenario is so comprehensive that a piece of custom code using the API and a nice template to collect the data would be the best option.

You have the Notifications.Standard.Paragraph.OnBeforeRender which gives you the paragraph object being rendered, including the properties (settings) of any attached module. You can change the settings on that collection at that point.

BR Nicolai

Votes for this answer: 1
 
Nuno Aguiar
Reply

Hi Nicolai,

 

If I understood you correctly, a"piece of custom code" would be in fact a custom module, right? So using the Notifications.Standard.Paragraph.OnBeforeRender is a different answer (refes to my attachment).

 

That being said, in terms of backend interface to view the data, do you agree on the Page / Sub page / Paragraph approach? I guess using the API we can have Pages for cases, paragraphs for Boxes and an actual item list for the prod_items, correct?

 

Best Regards,

Nuno Aguiar

 
Nicolai Høeg Pedersen
Reply

Hi Nuno

Yes, 2 different answers, and ye, custom module.

I would go for a page as case, with boxes as paragraphs of type Box wit lists of products.

BR Nicolai

 
Nuno Aguiar
Reply

Hi Nicolai,

 

Thanks a lot. It was very helpful.

 

Best Regards,

Nuno Aguiar

 

You must be logged in to post in the forum