Developer forum

Forum » Templates » Implementering VIsual Editor on a Mac Development environment

Implementering VIsual Editor on a Mac Development environment

Hans Ravnsfjall
Hans Ravnsfjall
Reply
Hi
 
I am developing on a Mac running Mac OS. I mostly use VS Code, but also Visual Studio for Mac.
 
As far as i know, it is not possible to develop using ViewModels in Dynamicweb on a Mac Environment as of yet?
 
Does this mean that I won´t be able to implement the new Visual Editor on a Mac Environment?
 
says you have to use PageViewModels
 
Hopefully it´s not the case that you can´t do it in a Mac Environment.
 
BTW. Anything new on when Dynamicweb will switch over to .Net Core?
 
/Hans
 

Replies

 
Nicolai Pedersen
Reply

Hi Hans

You can use viewmodels on the mac - you just do not get intellisense in templates.

You will have to wait for Dynamicweb 10 which will be .NET Core/.NET 5 which is supported on MAC - it is still out in the future - but we have started. More info at Dynamicweb Summit!

BR Nicolai

 
Hans Ravnsfjall
Hans Ravnsfjall
Reply

Ok, thank you Nicolau 👍🏻

But when using the ViewModels, you can not use the other way simultanously, right?

So that means it´s impossible or really difficult to implement the Visual Editor unless I switch over to windows? Or could I seperate the templates, and use include etc. so that only the Visual Editor part would use ViewModels?

 

/Hans

 
Nicolai Pedersen
Reply

You can combine templates using tags and viewmodels in the same solution.

But not in the same template. To implement visual editor you need a viewmodel based layout template and grid template. Your paragraph and module templates can be either viewmodel or tagbased templates.

Using viewmodels on mac is not more difficult than using tags. Just different.

Your template will just look a little bit different:

So instead of this:

<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    @GetString("MetaTags")

It will look something like this:

<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    @Model.MetaTags
 
Hans Ravnsfjall
Hans Ravnsfjall
Reply

Ok, but would it work to use Include in a pagetemplate? So that I would have two files. One where everything is tag based, and then I include the Visual Editor stuff using include?

 

Another thing - with tags I can use @TemplateTags as a part of my workflow. Intellisense in ViewModels would for certain be faster. If I use ViewModels on a Mac. I will have neither options, correct?

Perhaps I should switch to windows ;) But problem is I use other Mac Specific tools for other non webdevelopment tasks.

 

/Hans

 
Nicolai Pedersen
Reply

Hi Hans

You mean layout template? The layout template has to be either viewmodel based or tag based. You cannot make an include of a template using tags into a viewmodel layout template or viceversa. Includes is just a merge of 2 files.

You cannot use @TemplateTags in viewmodel template as there are no tags. You can either use the API docs, i.e. PageViewmodel: https://doc.dynamicweb.com/api/html/8175ac67-de8b-696a-7436-6505c1a61e47.htm or GridRowViewmodel https://doc.dynamicweb.com/api/html/2fec7670-6cc4-d601-1dc9-9496abcf5ce3.htm

Or all of them here - se the bottom: https://doc.dynamicweb.com/api/html/c0c19636-f848-e866-6208-ade44285310b.htm

The alternative to @TemplateTags is to use @Model.ToJson() - that will give you the viewmodel in json format with its value.

BR Nicolai

 

You must be logged in to post in the forum