Developer Blog

Webinar - Building a Custom App in Dynamicweb

Greatings everyone.

You'll find today's recording here:

https://vimeo.com/537718495

We have two additional webinars coming up befor the summer vacation:

On 7 May 13:00 CET I'll host a webinar titled "Exchanging Custom Data between Dynamicweb and Business Central", and if you're intrigued by the title alone, why not hurry on over to the sign-up page to reserve a seat:

https://www.dynamicweb.com/exchanging-custom-data-between-dynamicweb-and-business-central

On 11 June 13:00 CET I'll host a webinar about Indexing and take it a bit beyond filtering Ecommerce items. The agenda is not completely decided upon yet, but the date is set, and you can sign up here, if you don't want to miss out:

https://www.dynamicweb.com/indexing-in-dynamicweb

Comments
 
Unnsteinn Garðarsson
Unnsteinn Garðarsson
Advania Iceland
16 April 2021 at 13:26

It would be highly appreciated if you could zoom a bit in when doing these webinars, since it is kind of hard to see what you are writing.

 
Unnsteinn Garðarsson
Unnsteinn Garðarsson
Advania Iceland
16 April 2021 at 13:50

Can we extend existing apps like for example the Product Catalog app ?

 
Lars Hejgaard Sørensen
Lars Hejgaard Sørensen
Dynamicweb Software A/S
16 April 2021 at 14:06

Thanks for the input, I'll remember that for next time:)

You can write extension methods for existing view model based apps to use in your razor templates or API extensions, but afaik that's it for now.

 
Unnsteinn Garðarsson
Unnsteinn Garðarsson
Advania Iceland
16 April 2021 at 15:02

Will the latest webinars not be available somewhere on the web? They are missing from here.

https://doc.dynamicweb.com/downloads/sales-marketing/other/webinars

 
Lars Hejgaard Sørensen
Lars Hejgaard Sørensen
Dynamicweb Software A/S
16 April 2021 at 15:12

It will be available in the blog assiciated to the webinar as soon as it's done processing :)

 
Nuno Aguiar
Nuno Aguiar
Dynamicweb North America, Inc
19 April 2021 at 12:26

Hi

As requested on this session (and for the lack of better place), here a set of topics I believe would be interesting to see:

  • Working with Cache
    • And being able to clear it in Settings > Developer > Cache
  • Logging best practices
    • To leverage Monitoring tools as well
  • Adding items to Monitoring > Health
    • to existing topic
    • Create our own custom topic
  • Create a new UI for Global Setting
  • Create a custom Product Field type
  • Create a custom Item field type
  • Backend development cheatsheet

 

Some of these could be merged into a Tips and Tricks and potentially some "Do's and Don'ts"

 

Just some food for thought.

Nuno Aguiar

 
Lars Hejgaard Sørensen
Lars Hejgaard Sørensen
Dynamicweb Software A/S
20 April 2021 at 12:41

Thanks for the great suggestions, Nuno, and thanks for joining.

Just yesterday I was working on a feature with caching, so I'll write a blog about this some time soon.

About the control panel UI. You need a /CustomModules folder in your project/website, and it is good practice to have a subfolder named by the ModuleSystemName (this is a necesity, if you need a paragraph setup form for your app). In this folder, creae a webform for your controlpanel settings, and on the record for you app in the Modules table, add the path to your control panel page (/CustomModules/MyCustomApp/MyCustomApp_Cpl.aspx) in the ModuleControlPanel field. The page will loade inside a frame, so it can be anything you can imaging to load in a browser. The /CustomModules folder is protected by admin login, so it can only be accessed, when you're logged in.

To interact witl the GlobalSettings.aspx you can use the Dynamicweb.Configuration.SystemConfiguration.Instance namespace and use the SetValue for writing and Get[type] methods for reading, e.g. GetString(). The argument for key should be the xpath of the setting, e.g. /GlobalSettings/MyCustomApp/MySetting.

I think I mentioned my concerns about using global settings vs. website settings, so when considering adding global settings, it's always a good idea to consider, whether they should be added as settings on a website item. Also, remember, when you create a webform, it will need to be rewritten for DW10 when that time comes.

 
Bjørn Ingebrigtsen
ECIT Peritus AS
18 January 2023 at 15:28

Lars,

Thank you for helping me start building a custom app for DynamicWeb! 

I was wondering what the best practice is when building a custom app with many forms, list etc. As far as I can tell, each form/list needs template cshtml file and a "page" in Dynamicweb, so it can be targeted by another page. I didn't want to create an custom app for each page, so I created a manager class to select the right template and return the correct output, using the navigation property set on each page. Is there a different way to solve this when dealing with many Master/Detail and CRUD pages that will belong inside one custom app? 

Bjørn

 
Lars Hejgaard Sørensen
Lars Hejgaard Sørensen
Dynamicweb Software A/S
19 January 2023 at 08:53

Hi Bjørn,

Thanks for taking the time to write.

I would usually put everything in one template (or at least make the possibility to do so), and then use different modes from e.g. query string or paragraph settings to decide, what function to run. That lets the frontend developer decide how to put it all together in the frontend, if they want to publish a lot of lists in one page or in different pages, show lists and form together or what not. Then they can also work with the Visual Editor to do the implementation.

There are a few things to be aware of when having multiple instances of an app on the same page. If you post information to store in the database, all instances will receive the request and attempt to save. Redirecting after saving will only help, if it is the first instance in the order of paragraphs, but if you include the PID (for ParagraphId) in either the form or querystring you can set it to the value of the paragraph and thereby target and individual paragraph.

In Swift they use "Components", which basically means that they load the app once on the page and then adds the view model to the Dynamicweb.Context.Current.Items collection, which they can recall in subsequent paragraphs on the page.

Hope this helps, otherwise feel free to reach out :-)

Br.

Lars

 
Bjørn Ingebrigtsen
ECIT Peritus AS
19 January 2023 at 11:29

Thanks for the quick reply!

The custom app is communicating with an external system using OData and the only link between the external data and dynamicweb is a product id or customer id. We are not storing any of the external data in DynamicWeb. So when the user interacts with products or clicks on a meny item, we will retrieve a list of external items or show an input for for saving data to external source etc. Since there will be multiple of these, I figured the template would grow quite large after a short time so it would be better to have a template for each.

My plan was to create a dynamicweb "page" for each of the areas (then the url will give an indication what you are doing), and therefore there will usually only be one app per page, maybe 2 if I do a master/detail page. 

Is this the best approach?

Bjørn

 
Lars Hejgaard Sørensen
Lars Hejgaard Sørensen
Dynamicweb Software A/S
19 January 2023 at 11:58

Whether it's is the best approach also depends on the final ux, but it is definately feasible approach and definately not a bad approach :-)

Br.

Lars

 

You must be logged in to comment