Good afternoon ladies and gentlemen and welcome to an extraordinary session of New America Foundation's Conversation with the Prime Minister of Norway, Erna Solberg It's a great honor and a pleasure to introduce the Norwegian Prime Minister and Of course, I don't have to explain to you why she's a tiny bit late because we have all been stuck in in New York's week from hell All week so welcome madam Prime Minister and as you no doubt know by now the New America Foundation is a Washington-based think tank that crosses ideological and party lines and prides itself on original out-of-the-box thinking and I am Incredibly proud to have been Associated with the New America Foundation since its inception almost two decades ago So this is very much in keeping with the things that New America Foundation works on and and and we've got a my wonderful colleague Liza Mundy who will have a engage Prime Minister Solberg in a conversation Prime Minister Solberg is the head of a conservative coalition, but conservative in the Norwegian sense. I Think she is just from the brief conversation that that I just had with her. I think You're all in for a treat. I think that the Prime Minister is a terrific role model for all of us in in so many ways in achieving the work-life balance That we are all still striving for as well as her ability to govern across party and Ideological lines We obviously need help on both those issues madam Prime Minister all of the issues in fact that we at New America prioritized from from income disparities to climate change to gender equality to a Humane immigration policy all of these are The Prime Minister's priorities as well So we're delighted that she took the time on this busiest of all weeks to spend this with us and when Prime Minister Solberg is not working on reducing carbon emissions She likes to play Candy Crush on her iPhone Don't ask me how I know that I have my sources and she's also a huge booster of her hometown of Bergen's football club brand How are they doing? Okay, sorry I asked I have to tell you that I have a very special affection for for your country one of my most memorable trips was a hiking trip in Norway with With one of your great countrymen Jan Eglund and at the end of that hike we stayed in all Norwegians have a little shack with a with a grass roof and and by the end of the week I had developed Quite a fondness for filet of elk which which is what Jan served every evening it Also by by the end of that week my husband remarked that Having met so many wonderful Norwegians that in fact Norway isn't a country. It's an NGO In the best sense in the sense that Norway is the greatest global citizen we have so Madam Prime Minister Welcome and thank you for joining us and now over to Liza So Madam Prime Minister, it's a great honor to get to have a chat with you on the podium We'll be talking I think mostly about gender and workplace policies. I think many Americans I Have the belief that if it's possible for women to have it all anywhere and men They probably have it all in Norway. So we'll discuss whether or not that is in fact the case One just sort of biographical question when I was reading about your biography I noticed that at one point in your political career. You were known by the press as iron earner and And it did make me think it did have sort of harken back to Margaret Thatcher when she was referred to as the iron lady And we had a first lady in our country Roslyn Carter who was known as the steel Magnolia Because she came from the American South which is where women are supposed to be very Conventionally feminine and she was tougher than people expected So there seems to be some need on the part of the public whenever a woman is powerful and takes a firm stand To compare her to a hard metal for some reason as though it's Surprising that a woman leader would take a hard firm stand on something this doesn't seem to happen to male leaders I was trying to think of there was an example I can only think of president Ronald Reagan who was described as having a Teflon Presidency and that in fact was a non-stick coating as opposed to a hard metal But what do you think? I mean, do you think that people are still surprised when a woman politician or a woman leader turns out to Take firm powerful stands on topics now. I don't think in Norway. I think but I think I think there is always there's There is a difference even in Norway to between how male politicians are treated and how women politicians are treated I think I think it's It has to to a certain degree to it's because they you Might expect something more out of a woman on some areas One thing of course is that you get more comments on your hair do and your clothes and the dresses You wear to different occasions and all of that, but it's also I You should say is this is that different focus? Bad or good. I think it's good in some in some areas But I think the way that journalists would like to interview and portray you Gives a more More closeness to the people. I'm the most average politician if you look at Norwegian Norwegian newspapers I'm the most average woman in Norway. That's that's I mean how can such an average normal person be prime minister That's that's sort of the portrait and then they will tell about all the average things I do And and I think it's great. Yes Yes, the mechanic Russian and all of these other things is gets a lot of of it gets closeness and They expect that you talk about your family all of the things that you're gonna ask me about after us They will always ask me No male politicians, but I think it has this good side. I think people get to know you They feel that they can relate to you and I think I think that's a positive thing for a politician If you live a life, they can relate to on the other hand There is this image of how politicians should be when they have power and that they should be calm and have have all this Firmness and so the other challenge is if you get if you if you if you are portrayed as too nice Normal, how can you deal with the crisis? How can you sort that out? And I think that's the dilemma in a way I Told this story before to some I remember when I was a young member of parliament There was a lady who was a party leader of a different party than mine Who obviously cried because she had lost the discussion in Parliament and and and and a vote and I thought God have as you can't cry in the parliament because you lose the vote And then I thought why not 20 years later? I can say why not if this was the most important thing that you thought about Why shouldn't you be allowed but at that time and I think that's people still will think like that it shows your weakness in a way, and I think this balance between being weak and being average as It's it's it's a dilemma. I had to be honest about that But I think basically be called iron lady I mean it was it was made as It was it was said because of my immigration policies at that time And I had to tighten some of the immigration because we had 80% of those who who applied for asylum in Norway were turned back Then it's better to tell that you will not get an asylum So we did we did a couple of media stunts in Eastern Europe at that time was before the enlargement of the EU So telling people it well, there is no free access in Norwegian labor market through the asylum process and And that earned me in one newspaper this name ironer and then afterwards of course Somebody will take that word and use it negatively as being not compassionate in a way Which I think is is more difficult But I live with the fact because I think if somebody means that I'm firm and can make decisions I think it's okay because at the same time you can you can show your Suftocytes Yes, that's very interesting. Thank you for that answer. So in the United States, we're a country We have a commitment to equal rights, but we don't have any kind of political or institutional policy on gender equality We don't have we don't have a ministry of gender equality or or gender and I think Norway Has probably one of the world's most concrete and explicit policies about gender equality I'm sure there are Norwegians in the audience, but I'm sure there are Americans and others who don't necessarily know what this What what the country's policy consists of and I wonder if you could just talk about it a little bit Well, I think it's difficult today to talk about what our gender policies are you can talk about structures that we have That we have an equal rights law. That's specific We have an ombudsman who is who is responsible for following up that law who also has as in her mandate To to be an activist on on equal opportunities But I think a lot of what consists of our societies and more Better gender balance than a lot of other countries have is that it's it's mainstreamed into all the other sectors It's it's an objective that you that you find on all the different areas and that you in a way It's become more natural That doesn't mean that you don't have to push it But I mean we are above, you know, just the special measures because in our university There's a majority of women today who take higher education. It's We have a larger education in our education system. We have a larger problem with young boys leaving without Finishing secondary we have many of those yes And but we still have of course areas where there are too few women we have some special laws we have the law on the boards of big companies where there is a 40% quota we have a 40% quota on all different types of Committees that is put together You need to have 40% of each and and in my The last Problems we've had with that has been that there was some members of some Some departments in in our government who have tried to put more women than 60% And they've been turned down by the Ministry of Equal Rights saying there are too many women You had to quote a man to do to do that. I mean put on some issues you you get that but it's that's that that's That's the special laws that we have But but then of course what we have seen is that what we do on family policy, right? That's really important. Yes, that's I was including that as well Yeah, because what we do and I think one of the One of the things that maybe you should understand by the Norwegian society is that in in the 70s we had a very large and active women's movement which Integrated into politics very early and I think one of the reasons why Our society and maybe the Scandinavian societies looks a little bit different on a family policies Then then a lot of other countries is that in Norway and Sweden and Denmark women entered politics as a result of the of the NGO work the women's movement work There was much more women in politics in the 80s And and we had in fact the first female Prime Minister in 1980 we had the I'm the second one. So we It's not that we have only had female afterwards, but it's we've had but she also and her second government She had a 40% Women's in her government at that time a revolution internationally that you have 40% women in your cabinet, but I think we entered politics very early and Because of that a lot of those issues that was looked upon as private issues In fact become political issues in Norway and they became into the political parties agendas. That's why we we have our Well compared to American situation we have quite a long maternity leave I Think we have like 59 weeks with 80% pay 52 I can't even think what the percentage is you have like a thousand percent It means about a year. It means a year. It means the first year you can One of the parents can stay at home with full pay with with that Children we we started out this increase men started in from 87 and onwards the enlargement of the maternity leave as a part of also that I think focus on on Family policies the ability to combine Combine work with family. You also had an increased Increased a lot the the childcare facilities of Norway. So we have kindergartens We have taken a long time until having a reached a full level of a kindergarten of kindergarten But the former government which was not a conservative, but a red-green government reached the goal that we in fact set out All parties agreed in 1989 that we should have full coverage of Kindergarten for children in Norway and and it was reached by an by an increased effort by the former government in 2007 2008 so we Today you can have what I think is an affordable kindergarten You for I'll be from one years to six years So to your kids starts to school and you have this year one year maternity leave first I think what I said This is sort of a basis for what we can see that women are participating in our society in the labor market Much more than most other European countries there are and I think that's been it's been Important for all political parties in Norway You might have discussed a little bit on the different levels and how much subsidies, but I think we have agreed on the fact that Giving if you have want to have true the truth freedom of choice You also have to have the possibility to work out your family life if you want to have Women participating and have the full freedom of participating in in the labor market and of course in Norway You have also instituted of measures to Entice men to take a portion of that leave because it's always difficult for countries even who that offer paid paternity leave To actually entice men to take that leave And I think you all have carved out a certain percentage of the lead that can only be taken by a father Yes, it started up for the four week which we have had since I think I'm not wrong from 1993 94 we separated our four weeks that of this Which we could shouldn't call which is apparently of them Which only the fathers could do it dad has the last year has been increased It was up to 14 in my government We have reduced that back to 10 weeks so that the rest can be voluntarily between the family That's a division line and in Norwegian political life How much should we as politicians decide that the family should divide between? The father and the mother and how much freedom should the family themselves have have do we believe that after nearly 20 years of this? Quota for men that we have reached a more equal society that makes it possible to Increase families own own discussion on how they deal with their the first year or have we not reached that level? That's a big and hot debate in Norway That's really interesting because I studies have shown that you know that men are very reluctant to take the leave even when It's available unless it becomes Exclusively available to men and studies have shown that that men often feel stigmatized taking leave But if there's a portion of paid leave that can only be taken by the father then The men begin to feel stigmatized if they don't take it And so the this the sense of stigma can be sort of manipulated by the government policy It sounds like you're saying that perhaps Norway has reached a point where we don't need that kind of behavior My vacation that's a big discussion and my party voted over this before this election and decided that we've come to that point and I and I think I think you can always ask Should you as politicians control family life as much as we do forever or is there a time limit and have a reach that time limit? So we decided we'd reach this time limit limit now for it But it's that's up for that's really interesting because governments control family life, you know through all sorts of policies It's always it's it's just a matter of sort of How right I mean and it tax policies control family life They're all sorts of ways to levers right well it yes, but on the other hand, it's also if you have it If you if you give this Solid some families will not have the possibility to use it. So I think Family leave is for the children. I think you can discuss this in equal rights terms But I think it's the basic thing is that the family should be allowed to stay at home with their children I think it's good for that part and if some families Looses out on this time then you then you reduce some families Possibilities to stay at home with their children and I think that's the dilemma. Yeah, I so it's a question of the philosophical question of what What purpose does paid parental leave serve because it's certainly being used in some case as a way to enable women to take more paid to increase women's labor force participation to Enable women to spend more paid Time in the workplace by getting men to spend more time at home And so you're saying that that's not necessarily what we want to use it for to control women's labor force participation It's just to ensure that somebody's there with the job to the words control women labor force participation I think I do this for children. I think that children shouldn't be left in a kindergarten at three months. I Think they have good times at home for one year I think that's an investment in the childhood. Oh, so so I have I'm a conservative politician I but I believe in in pushing society, but I do in fact have a Yeah, I get a back edge when people say controlling women's labor participation because I think I think we should Not have that ambition as politicians, right? And I didn't really mean control. I think I meant enable because I think what What has also been found and and in in northern European countries like Germany And I think this is true of Sweden as well when when parental leave policies are exclusively that exclusively available to women Or when they are too long then women get Shunted into lower paying Sectors of the workforce. So I mean there is I think a constant Calibration that's going on and from this, you know from our vantage point We can look at northern Europe and the Scandinavian countries and see very interesting Calibrations how long is too long of a maternity leave to offer women so that they just don't re-enter the workforce or Or or go into pink collar type of occupations And so it's interesting to hear that you're talking about dialing back or or I guess returning to a situation Where families can choose who's going to take the leave? Yeah, well, that's that's a big discussion as I say in Norway And I think it's after 20 years. Have you changed the society or not? I think we have changed our society I believe that many in our society now Growing up now they they they have a role as Fathers that is much stronger because their fathers have stayed more at home with them So they have a different. I mean, I think we have shaped our society differently. That's really interesting. Yeah, yeah We're so far from being in that place and just to go back to one thing that you said because I think this is so important Of course, we had a woman's movement here in the 60s and 70s also But it did not result with women immediately going into positions of political power either locally on state levels or nationally In fact, the US Senate up until the early 1990s had only ever had one or two sitting female senators at any time I mean that recently there were only one or two women in the US Senate and even now we just have 20 Which is one-fifth of the Senate Why was it possible for women in Norway to immediately go from the woman's movement into political life? I Think it has something to do with our election system to a mass or money Yeah, yeah, and of course yes We have we have a different election system and we also of course don't have all of this our Politics of finance differently than American politics are We are in a way governmental finance You might react to that but the fact that most of the political parties in over we get sponsored Get money from the government and the local the regional and national level based on the percentage of the last election So you get you know to run your parliamentary group to run your local constituency group to run your Party you get that type of financing I think I think that's Might discuss it if it's good or bad some would say that it Then of course always give the bigger parties more money because they did a good re-election the last time It it can firm the structures in a way because But but on the other hand you don't have to go around getting all the money to run a campaign Which I know for a lot of women feels more difficult than for men and sort of getting money to and The second thing I think is we have we have districts election districts that you parties put up a list So it's not one person was voted in from it from a region or district It will be my in my constituency We are 16 members of parliament who are nearly all political parties are represented from that Region and from my party there are no six members of parliament From that district that means it was easier to put up more women on the lists and It also have the effect that to get votes You also had to appeal to women So I think there was a Some parties had a quota system I think in most other parties would put up more women on the list because I said if we don't have enough women If we don't have enough young people on the list We will lose some of the youth vote or we lose on the out of the women's votes And so that led to a lot of a lot of women into politics and when they first had come there They didn't leave they sort of stayed on and it became the norm And I think in most nomination process in political parties today They would they would try to strive for 50 50 percent on there on the lists My party does not have a formal quota system. Some of the other parties have But in my constituency Bergen, which is nice next second largest I'm very enthusiastic about that. That's true second largest city of Noah. We had and We had a discussion on the quota last time because we had a Female candidate for mayor a female candidate for the leader of the of the city council and also a female leader Candidates as a third one on the list. There was one male who said maybe we should discuss quotation and he was laughed out So it's I mean it's in it's an extent because still in local politics. There are more men than women but I think it's it's Become normal that there are a lot of women and they are sick and they are influencing the political agenda in Norway much more And I did it especially in the 80s and the 90s So why has it been hard in Norway as hard? I think in this country to To see more women CEOs I know Norway has the 40 percent of women on boards quota But the numbers for women's CEOs are not better than in this country and they're a little bit lower We took a long time also to get enough women as professors at the universities and I love it much slower in and at the academic life and In business, I think I think we all are looking for What's the real reasons? Why why why don't we see all of those very well-qualified girls? Who are coming out of the universities right getting into the jobs? Why aren't they at the top? I? Think I'm looking for the really concrete answers to that still I think I think maybe there is a sort of a glass ceiling There's still a there's still a this I Said there's still a large demand for for being perfect and I think a lot of women put that on their self You should have your perfect Nice family you should have your good career and you should also manage your nice house and all of these things And then of course if you do all of these things You you might at some time just say oops, it's too much and I'm I'm a big fan of getting people to lower their shoulders and Decrease their ambitions on some parts of their Some parts of their life so that they can really fulfill some of the other ones And and I think I think that's that's a challenge It's a challenge that we still have men. I think who appoints Points people who are looking a bit like themselves And that often happens to be men that looks like men and And I think that's a that's still a problem that you look for you might think that you're not biased But you look for the same type of qualifications Then there is a structural problem in Norwegian society, which is the fact that We had in the 70s and we still have one of the most divided labor markets Women are gender segregated labor markets women were educated and and into social The social work fair they were into hospitals and doing nursing teaching all of those large public sector areas And which all is all public sector in Norway. There's a lot of women who are leaders in that sector and and and much Fewer took the technological Education and and I think if you go into a lot of if you look at the CEOs that are around there are two types So there are of course those who have their background from business administration But a lot of them and have background from engineering from from the type of production the type of core line of the company and When there are very few women who have gone into the tech the the natural sciences the technological Educational system there will be fewer of them in line for That type of jobs and and you will see that in some areas in the private sector There's a lot of women in finance in in in laws in all of these illegal firms and and and and human resources But we still lack and we have only the last year seen the bigger increase of women into to engineering the Technological areas the research and development of those and I think we need even more there to make sure that we have a Larger group of women to elect CEOs from in the future. Okay, that's that's really interesting and useful I'm going to open it up questions, but I had one question that someone Requested on Twitter that I asked you and I feel like it is a very important question And it has more to do with women's global leadership I know that you are very active globally and having to do with girls education and the Millennium Development Goals and so Someone on Twitter wanted me to ask you in terms of women's global leadership How can women be effective global leaders and diplomats when not respected in a significant percentage of the world? When we're at a global point where Gender attitudes are so disparate in different countries. How can one be an effective global leader? I don't think I I of course there are some countries that have a view of women that is I Would say middle-aged Without understanding that they are Lacking out of the talent of of the whole basis of people I think there are very few levels in international politics where women are not heard because they are women I think there are very few of them who even in countries that we would say have a very very Large problem with where women have large problem with getting Access to basic rights. They still is a lot of elitist women to be honest There was a lot of elitist women around And and they have large influence. I mean better see but to in Pakistan Pakistan is a country I would say would where women do have their challenges for the respect of women to It's a modest evaluation of that I think in India where we see the large rape case all of this Still there's a lot of women in politics So I don't think there's a lack of I don't think there's a problem with the lack of respect It might be a bit difficult to to get the Islamic State to listen to a women's leader But I don't think any of us need to talk to the Islamic State. You just need to disrupt their activities Okay, thank you So let me open it up to a few questions and your hand went up first or the first one that I saw and I'm sorry I'm a little blinded by the light so I Many countries have a problem with very low birth rates and are offering special incentives to women to Get pregnant and for families to have children. Is that the case? Norway No, Norway have if I'm If I'm not wrong, it might be on the line, but then in the last ten ten years if you see on the average Norway have had I think the second largest birth rate in Europe Ireland has had a larger birth rate and of course They are controlling births in a different way with the problems where you can't take an abortion and your contraceptives have been difficult and and And they come out of a different view on this We have we have had nearly the second We have more or less been stable on the second largest birth rate And I think this is due to the fact that we can combine a career with having having children and And we are not combining it in the way some countries are doing with the fact that very wealthy women can have a lot of Higher and help because we are very equal society. So it means that You you get this division of labor at home. That's And and and luckily enough the last year's the divorce rate has also gone down in Norway I'm not going to speculate how much but I think maybe it's a result of the fact that that maybe more Equal marriages that fact that you but we have a more equal society also leads to Family life becoming more stable After some years with increased very large increased divorce rights right here The microphone is coming I'm from UN women and Prime Minister Norway I always hold up whenever I go around the world. They ask me which Countries are the best for gender equality and women's empowerment, and I always say Norway and the Nordic countries are What do you think for the countries around the world and for UN women? What do you think? Are the silver bullets? I'm not going to say one, but what do you think are the silver bullets? What what do you think we should be prioritizing of course? We have the priorities that the member states have agreed on but what what do you think in your experience of? Norway and as a leader of Norway now How do you see it? I? Think it's extremely difficult to adapt from one country to another country I mean we develop based on our history culture and other things So what might have been the most important things in Norway might not be adapted in a different society But I think there is one silver bullet for women in the world, and that's education I think education is so interlinked to all of the other areas that is is of importance for women I think especially in poor countries for big gender differences where you see exploitation of women you see human trafficking health Very large differences when it comes to health. I think education is the single most important answer because if Both men and women was especially women get educated you can take more informed choices of your own life They have more control over your own life You might have control of your way to to sustain your own living and that's that's the biggest start up at all then afterwards you can discuss Family leave and all of that when you're a developer country even more But I think to start the starting point is is education. And that's why I'm also working quite a lot on on on Education and through the MGG advocacy group that I'm co-chairing and I'm trying because I think this is This is what really transforms the society Back back there Thank you so much for your for coming here today So while we're on the subject of Women and children and may you announce that you were opposed to an Israeli boycott of goods And in light and in light of recent actions in Israel Against Palestinian civilians many of whom are women and children. Have you reconsidered your stance on this issue? No I don't think boycott is the answer to that. I think there are two parts that have to also To to to look into what they're doing. I think the Hamas shooting towards Israel is Is a large problem that the Palestinians have to deal with on the other hand, I think it's It's been un-proportional answer from the Israeli side to that type of attacks and And I think we should dealing with the humanitarian situation and Gaza is extremely important But I don't think the answer is a boycott of Israeli goods Um a couple things I'm involved with the arts and I've met some Norwegian film directors and I've noticed that there's a One that's been prominent that's of afghani. I think afghani are Kurdish background So I see that in the arts there's a way to Sort of affect society by the presence of filmmakers such as this gentleman Do you see ways? But one thing I've noticed is I haven't seen as many norwegian women in the arts that have getting international recognition Is there some effort that can be made to Do that or and I don't know enough about how How many opportunities are for women in the arts in norway and then the other thing is Are there efforts on your part of your government's part to Because you do have a something of a muslim population there in norway to Do things to get people's more aware to develop a more progressive or moderate Muslim community that can get the message out about better treatment of women and such Start with the arts First of all, I think I'm I'm not sure we have very many international We know the current norwegian artists on other levels except for the fact that we have a couple of authors So I've at least two norwegian newspapers. I've done very well in in the new york Men who write very movingly about family life. Yes, and uh, I never managed to read through his books. So I can't say Sorry, sorry. I got bored after a hundred pages, but it's No, it's um We have I think it's we have quite a substantial support system for arts in norway And it's and if you don't if you have I think I'm not sure if we can do it Gender-based I think in the arts it's important that we in fact say there is a one qualification and that is Not your sex but the quality of what you're doing And and and we have quite a substantial support for arts, but I'm not sure if I want to have a women arts program Because I think I think that sometimes also leaves the question. Is it second rate? Or can it be? Or is it of the same quality as the rest and I think it's an increasing increasing question asked by Young women in our society that special programs are we second rate? To me who come out of the Who who became politically active in the last part of the 70s as a 15 16 year old and And to to me it's it's a bit of a surprise, but I think I think that's that's quite a strong statement from for girls in our society that Maybe it's naive I sometimes tell them a little bit Maternal that it might be a bit naive because you will see the obstacles when they show up in your life That it's that women and girls are not treated the same way. I think it also comes into the arts Um, we would like to see much more Norwegian arts and our quite large investment being more international recognized So, um, I think we should work on the program We're getting more recognized whether it's men or or women who are doing it But our most we known Director for the time being of movies must be libyl man who of course had her career basically here Before now. She's made her first movie for I think 10 or 12 years or something And which just was released. So there are some quite renowned women and then we have to work on ambitions Because I think ambitions is a bit Wanting to get out of Norway not just be good in over but getting out of Norway is It's important Well, we have a we have in a large good. We have a very good group of women authors They write as good criminal Novels as UNESCO does so they should have been translated and sold more in Outside Norway. Well, I hope publishers are paying attention because I'm a great fan of Norwegian crime fiction And when it comes to we have To the Muslim community in Norway, we have Quite a good I think good cooperation and work we have for a long time had Try to meet all of the immigrants What we are cooperating Towards the government And I think we what we see also is that they are increasingly coming into political life And we see it In also the capital that there are more minority representatives in the city council. We are seeing it around the country But I think and I think we we have just launched a plan for an action plan for against radicalization and extremism and one of the Most important thing is to make local communities work together with Communities of immigrants to to make sure that we can catch youth Before they get radicalized that we can make sure that they have this dream of How they can develop in our society And and I my feeling is that we have in fact quite a good cooperation between Muslim communities and and different governmental bodies in in Norway And of course we have a problem with forced marriages like all countries have There there's a there's a There's one thing is and we have had a lot of focus on this um On working against forced marriages working against all family structures I think one of the big challenges is besides the historical cultural thing around arranged and forced marriages. It's also is a ticket into a Region welfare society To get to work. I think it's it's it's a lot of parents that feel that Their girl should choose to herself on the heavy pressure from the family back home For sending some of the other the youths into A labor market and into a welfare state that is and and it's a tough situation in minority families Because marriage and family reunification is a way of getting into our country I think we have time for one more question So right over there the right. Yes you looking back. Yes to see if it's really you. Yes So I had a question about the bridge between Education and the workforce for women you touched upon the idea of like perfectionism and the expectation there In the u.s. In terms of education right now We hear a lot of talk about the soft skills needed for like resilience perseverance against failure For a lot of our underrepresented communities Which I would include women in So I was curious if you had exemplars or ideas about What we could be doing better and earlier in the educational process for women When I talk about education I talk a lot about those countries where People don't get an education in norway education is Free is universal you can go to university without paying I mean you can get a student loan So you don't well you have to work beside because the student loan isn't big enough to to have a You you you have to be very good with your money if you manage to To live on on the student loan, but it's still it's one of the best Systems that in europe I think the danes is a bit more generous than we are towards the students And and what we see is that among minority youth in norway there is They are now in especially in medicine And in in natural sciences They are in fact the larger percentage of those Of of youth from minority groups that go into universities like our education and from the Norwegian youth Not all ethnical groups But on average that's the picture I think that's because Their family is prioritizing quite a lot on on education Still we find that among on the other hand among some of the young boys Who don't succeed as good as in the education system earlier they fall more out And and and that's one of the challenges in in in our society because we don't have we don't have unpaid We don't have unskilled work where in many areas where you can do unskilled work in our society because of our Yeah, I was our Very narrow wage differences are our small inequalities a lot of jobs Disappear from our society because you can't pay for you don't get paid for those For example in in private services and things like that How can we deal with the better educational system? I think I think basically making sure that people learn the basic skills I think that's the basic skills is the most important if you know how to if you know your mathematics If you know how to read and write if you are in Norway also learning basic English enough You can you can continue taking more education There's a lot of other things that we are doing in schools which also is important For example, Norwegian youths are quite they are learning a lot of the on democratic skills And sometimes parents things that they have learned too much about democracy I mean, it's uh, it's a challenge sometimes they have They have all of these hours that they are learning how to argue for higher rates of money or higher But it's uh There's a lot of other things But if you if you really focus on on making sure that everybody gets through on the basic skills Then it's much more easy to increase The level of knowledge afterwards our biggest challenge and that's a challenge in Norway is Is that too many Are not reaching the target for the basic skills So when they go to secondary school they drop out not because I mean often have a discussion How can we change our secondary school system to make this better? But the problem is in the primary school level because they have not achieved the skills needed for taking further education And I think that's To make sure that you have a very good system for basic skills I think it's the most important thing you can do in an educational system Because after that you can learn you can read a lot and learn a lot. But if you don't have that Then you drop out Well, thank you so much prime minister. This has been a great discussion. Thank you so much


Good morning everybody. I'm John. How's everybody's Drupal con going? I don't know about you guys But I've been learning a ton all week. I've really enjoyed it and particularly learning about things I didn't even know exists it so you know connecting with other people doing similar projects There's it sounds like a lot of us trying to solve some of the same problems of how to connect front-end to Drupal and and get the best developer experience out of it make it easy to do so Thought I'd share the story of how we are solving this problem at at my company Freelock right now So what we are? It's interesting my slides are not in sync here Try refreshing Okay, let's see Will it get there so what we're gonna cover today is basically a little bit about you know What is progressive enhancement? Why would you choose this over fully headless or just straight Drupal? Some examples of things that we've done and then we're gonna get into the a little bit of the weeds of how do you actually hook this up and do it So you know I'm was setting out some goals. They asked from the speaker proposal What are you trying to learn? This is what I'm trying to kind of get across is Just a couple of techniques for developers to get started putting a view application on top of Drupal And this doesn't have to be view there's lots of other ways of doing it We're using view as an example because that's the platform. We've chosen and what we're what we're going With so first question is why? Why are we doing progressive enhancements instead of fully decoupled and there's you know There's quite a few different ways of looking at this. I mean first of all, you know Drupal is great for What it was and what it's been for the last 15 years and it's got some really powerful Technology under the hood the ability to extend and do all sorts of things beyond just content management systems We're doing a lot of event registrations membership sites a bunch of interactive things that that is just a really nice There's a lot of support a lot of code a lot of best practices available for But we're not really all that comfortable using JavaScript as Drupal developers So, you know, it's kind of a new technology area on the other hand single-page apps or Decoupled headless apps those end up having two completely separate sites. You have a front end and a back end and and So you've got a lot of a lot of things that you can do to really have a nice user experience And that's the main reason that you know, it's kind of a little bit more of It's no longer the WordPress versus Drupal. It's it's the back-end sites versus the front-end sites And front-end, you know, we've got view. We've got react We've got angular that are all just really able to deliver Whole new classes of user experience that you just can't do if you just have a page at a time coming back and forth But you lose all the stuff that you get from Drupal You lose a lot of the you know, you have to figure out all the answers around accessibility around Multilingual around, you know, you name it There's problems that Drupal has solved that you have to solve all over again when you go headless And so and it makes it really expensive and hard to change for clients So we're working with smaller end of the market, you know a lot of nonprofits They just don't have the budget to do fully decoupled, but they'd like some of the user experience Benefits of it. So that's what where we find this area in the middle of progressive enhancements and this is basically taking a normal Drupal site Drupal theme and adding some of the the UX richness and improvements that you get from headless applications and frameworks and Putting embedding them in Drupal and so it's individual widgets might be entire sections of a site a variety of things there You do get a lot a lot of it is similar to doing headless You've got to figure out how to connect the data to the back end and that's what we're going to talk about later in the talk But it's we find it to be a really nice place to to be developing especially With a lot of existing sites that are already on Drupal and being able to add and functionality and really improve them So going back into a little bit of how we frame the history of JavaScript When we started here, there were some early toolkits the jQuery dojo ui, you know jQuery went into Drupal core early on and these are just There are things to help you do consistently across browsers. It helps sort out some of the cross browser issues But they didn't do a whole lot for you browsers have gotten a whole lot better and Do a lot more of this for you. We're calling generation to you know dojo is one of the early ones And they've done they did a lot to kind of establish some patterns It was always kind of a library that not many people used how many people here do use dojo out of curiosity nobody, okay We we used it quite a bit early on before even coming to Drupal So this is something that we had had been and and they built kind of a store pattern back in like 2005 That are very similar to stores in the modern frameworks But it didn't get much adoption and most of the people moved on to other things In fact to one of the the actually the the originator of the project is actually went to Google and first made the Embed the Chrome browser in IE plug-in that we all used to use and then Has really been one of the instigators of the web component spec So, you know dojo is actually running through a lot of this in the history Current this is what I call the current generation react Vue. J s angular You know the the first generation of angular was completely rewritten. It's now, you know, these are all reactive So it this has taken that store concept of having a client-side data store And made it so you don't have to do the wiring up to with the UX You just change the data in the store and the UX updates automatically Which is so nice as a developer to just to be able to work with and What I'm calling the next generation are web components primarily I mean web components have been around a lot a while, but we're not actually using them I went to that talk on outline earlier this week and and I think it's really exciting I definitely think this is where things are going and Svelte is is a Another framework that I've been looking at a lot that is avoids the shadow DOM as a whole and and is a lot closer to web components So both of these I think are really interesting. So just sort of setting the the background. So why did we choose Vue. J s? It's these things. It's easy to learn. It looks like HTML. It's declarative We're generally try to stay away from the front runners in the market because often we find that there's Over they're overhyped and and and there's better quality solutions down the stack That's not to throw shade on anything. I think react is a great framework And obviously there's tons of people using it and they all do the same thing. So there's This is really an arbitrary choice like so much in technology But it's the one we chose and we've been really happy with it. We've been using it on a bunch of projects So so that's what we're going into so Switching gears a little bit, you know, what should you be enhancing? What are some examples of things that that you might do? We've actually done quite a few Things this is a partial list, but they're generally interactive components of one sort or another that They were just sort of plugging in smart widgets and building So, you know, there's there's a variety these they're just you know end up being components that can drop onto a web page And and what we're going to show in a little bit is how to actually get started with some of these something along these lines So here's a couple of examples in a little bit more detail this is a project for a an NGO called Better Care Network and they are a library of 11,000 documents at this point. I mean it's growing like dozens of documents a week it's a very interested in child welfare around the world and so they have they have done a lot to kind of share practices across a wide variety of organizations and communities and Methodologies and how to improve this in the situation and they had a really complex model for how to actually engage with all of the The content they have on the site And so we worked with a design firm to come up with what we call the puzzle project And it basically helps people Get a mental map in their head of the various areas of practice in a very dynamic animated way of Letting you drill down to the actual content that you're looking for And see the relationships with other content. So in their vast library, they've got a really easy way to Get a handle on it. We built this using taxonomy as the prime the prime back end So these each one of these screens that you're looking at is essentially a taxonomy term And it's a nested hierarchical taxonomy so at the top level was the ring and then you drill down into these these areas and The the client can edit everything on this page just on the taxonomy term page using a normal Drupal Drupal form Change the color change the background image It we've made it so that they can have up to 11 pieces it just automatically gives them a shape that fits the the pieces in there and and And then we matched up the routes. So each of these taxonomy term pages We have a use path auto to create a nice path using the hierarchy and we use view router to sync those up So we got both the search engine benefit when the search engines crawl the same URL as you visit They can bookmark one of these send it to somebody and load it up Another example is we're working with a company now that has kind of a sophisticated data model Animation actually going to run here and This is basically for the insurance industry and they needed To provide instructions for the users to pick the right insurance company out of this mess of hierarchy And trying to you know find the the right one. They need so they needed the description Associated with each taxonomy term and so we built a quick little widget that just shows that And then it also had different rules about walking this taxonomy to children parents We love using taxonomy for it seems like we've settled on that as a solution for a lot of things just for the hierarchy And then Right lost my sink here. What was going on? Oh? There we go And then we have an internal tool where we're using this for project management and in this we are able to kind of track tasks Open up a different modal windows to edit things Sort and edit and drag and drop and doing a variety of things to serve building dashboards that bring lots of Lots of pieces together. We're actually in the midst of another one of these for a client that does accessibility work with the buildings So they do ADA compliance Not like we're used to on the web But are there ramps on the entrances of the building or is the the heights for the light switches and the colors and all that And so they've got a big survey that they want to take out into the field and have an iPad and just sort of Put their notes in for the the barriers to various compliance issues And they want to have all the right context because it's you know The project the building the floor the room They need to be able to add and manage all this this tree of information and make sure they're adding to the right Right one so it ends up in a final report So a few things not to build We really always start with the user experience so we're always thinking about our editors and authors as the the user of this and a lot of times it's You know the problem with going fully headless is if they need to change something they have to come in and get a developer But if we can build in the experience and so they can just edit it and do all the stuff they need It they love it. It's a really great way to go And so the the the other thing about it is you know when you're going Headless if you're doing something that that is going to change over time and how many people have a website that doesn't change over time All our clients we have one client that we just picked up that is fully headless now And they haven't updated their site. So it's on Drupal 8.3 And they can't make the changes they want to make because they don't have developer support So they found us and we're going to be redoing their build pipeline so that we can actually do all that sort of stuff All right, so let's get into some code that's kind of the overview here So we're gonna spend a little time on just sort of how to get a view widget loading in Drupal How to use JSON API for accessing data And and spend a little bit of time in that just gonna touch on routes a little bit, but primarily it's the first couple here So first off loading view in Drupal These are the steps and it's really straightforward once you've done it a couple of times. It's like five minutes So first of all, it's a create a module and we love using drush So here's a an abridged example of using drush to generate a new module And step through and answer your questions when you're done you end up with a Drupal module in there you can enable it again with drush and and there you go you now have the The container for your code So next if you're doing a block, this is a simple block You can generate a block with drush as well Very simple framework and plug-in most of you should be familiar with this We also do field for matters or field widgets quite often. So There's other ways anything that'll take a render array. We'll use this pattern. This is just your your stock Set up for it Place it on a page all normal Drupal stuff. So everybody in this room. Hopefully is comfortable with this View so this is similar. There's a great project called view CLI Which is a way to bootstrap a whole view project similar to the react create app You need no JS on your computer with that. It's pretty straightforward install view CLI Change into your module directory. So we like to bundle it with our module or if we're doing in a theme We'll put it in a subdirectory of the theme So when we so basically we start in the theme directory run this command And then it will generate the the base view framework here and so there's the the part that is view that's nested inside our block and There's the our custom Drupal block in terms of the code So that's the skeleton framework next thing is to make them talk to each other and And so So there's several parts to this Not many that's not it's pretty quick These are the things we need to do with view and we'll go through each of these and then on the Drupal side It's it's getting the the JavaScript hooked up So first in view we create a build target So this is something that we've done a bunch of different ways and this is the solution We've ended up with view has a built-in support for a JavaScript library called nv.env and this lets you have Both a dot ENV that gets read automatically with environment variables And you can have a different one. That's ENV dot ENV dot development That's only run when you do your local development builds in in view and so we declare basically the the the end point and the assets directory through that and so basically it's a view config js is These are this is a place where you can override the default behavior of the view build and when you create a project this file doesn't exist So you have to create this file drop it a few lines of code And then in the package JSON We will add a Drupal as a build target and this is just the pattern We've adopted that moves the build when you run this it moves the the built JavaScript outside the view project and into the Drupal project We also turn off file name hashing because by default most of the front-end projects will add a hash to the file very much like aggregated CSS or JavaScript in Drupal That makes it hard to load that in Drupal So we end up turning that off so that we don't have to change our library's file every time we rebuild and Then there's the rest of the context around it and then npm run Drupal after defining that will We'll build your project for production and drop it into the assets directory So next is the Drupal side So now that a view is built They're now in assets and the index HTML will show you where the script and CSS files are That index Index HTML is a single line So it helps to have something to pretty print it so you can read read it easier and find the exact names of your bundle and job of the JavaScript and the CSS and those are the things that you're going to put in your library's YAML for Drupal to load and so That's basically it the the other parts are pre-loading We haven't really delved that far into performance improvements and best practices around that We figure that let's get the files into JavaScript load them up and we'll do the optimization on the Drupal side when the time comes And if you do add stuff to view or split your project out into layers This will change so you may need to come back and update your library's file so and then finally the last thing is getting your DOM element in your in your project or in your render array in this case, it's targeting this the stock ID of app and It renders on your page and that's basically it That's all all you need to do to get view loaded and from then on your you can develop straight in view and And you don't really need to do much more in Drupal aside from enabling JSON API and the next section so so next we're going to go on to how to actually get data in and out of Drupal to view and There's a lot of complications in this and there's a bunch of different solutions And I've been talking to people here about different alternatives This is what we're currently doing is kind of our our example and so we've built a couple of libraries to sort of help with this So here's the the first part The part of the problem is if you're doing something more complex in view It's just too slow to NPM run Drupal clear the cache wait for everything on front-end developers are impatient We want to see that the example right away So so what we're going to talk about now is how do you get it so that you can access data as an authenticated user? When you are in a headless environment So setting up that headless environment so you can be at local host accessing your data and And access it as an authenticated user so that you can see everything you need to see as you're developing and so there's a And there's another complication is the the deployment of this after you've built your code Some of our early projects we ended up before we figured out the environment variables trick we were hard coding in an absolute URL into our config file that would built and Then that always pointed at production and you couldn't really test changes in Drupal Because you know if something actually broke your Drupal site before you released it You didn't know because you weren't actually looking at it So having that environment variables set for your endpoints in your dot ENV file just works beautifully It solves this problem really in a nice way So the dot amp development you can you can add your dev site address right there and And then you can you run that on local host so So that's yeah, that's it that's the one of the key tricks next thing is the the actual authentication bit and I was actually just I Ended up writing this library just a couple of weeks ago because we were I was trying to get other developers able to be productive on on the accessibility site that we were doing and basically this is meant more for development than anything and basically it's a Leverages Axios, which is a JavaScript request library and it uses interceptors to inject the headers that you need for either OAuth authentication or The C-Serve token the cross-site request forgery if you're going to write data back to the server as a using a session token you know which you can do if you are Embedded in a Drupal site you have the Drupal session and you can read the data as whoever you're logged into the main Drupal site with But when you go to post it back there there's a Basically, it will deny you unless you pass a C-Serve token and so this will just handle it for you If OAuth isn't configured I was talking to someone the other day Brad I think I mentioned that there's a core bug around that so you can actually turn that off turn off the requirement to do the C-Serve token So this may not be as necessary going forward, but even right now this is one of the issues that you would hit And that's one of the reasons we did this so basically you drop this in you will need to pass it a pass you will need to set up simple OAuth or some sort of OAuth flavor and Drop in environment variables to configure it to actually use OAuth. That's a fairly quick thing to do But it's another whole talk It's a it's a it's a complex topic But once you have your your consumer application in there You can just specify the UUID and environment file This will pick it up and inject your token and that's just using the simple client authentication Flow and in OAuth, which means that you need to provide username password View X so how many people use view or view X? It's a view view X a Lot fewer okay reasonable amount using view so view X is a state management system. That's built for view the modern JavaScript Has a whole bunch of different libraries and you can kind of pick and choose the ones you want So as there's other ways to go, but we've found view X to be really useful We found a view X on a library called restate view X that is built for JSON API And when we found it it was already marked abandoned So we we forked it and basically made some changes to make it work easier with Drupal particularly around When you are talking to a JSON API server on Drupal the endpoints will be entity type slash bundle and but the the type you get back is any type dash dash bundle and This translates back and forth for you automatically so you just pull it in and you can register The endpoints that you want to access in the as view view X sub modules So that's aside from the the imports. That's the entire view X store to get started and Then on the the right side Yeah, so the right side is your component is an example of a component mounting it and and loading it loading the data and rendering it the render template would look like this and In view you can have single file components So the the all three of these last chunks are in a single dot view file template script and and you can have styles as well So I kind of split out the the scripts here so you could see the the the important parts so what you end up with with the the restate client is You basically just we we registered it in the in the store here node dash dash article When the the component is mounted we issue a call to fetch the data and so the this this module will fetch it stored in view X And you can always call load again. There's a variety of load methods. You can load by properties You can load by ID. You can load it in a bunch of different ways. It'll keep it there in view X and then The other thing that we're doing here is there's a bunch of options in the json API for Drupal for including related objects and picking which fields to load for each content type and The way we handle that is we just sort of put it in our store so we can access the same set from all of our components And then we just attach that as an argument when we load the data or Or get a particular object so this this library basically has those two basic steps There's a load step and a get and and there's parallel methods for each one And if it's already in the store, you don't need to load it. So what you end up with in the data binding side We've got a method for wrapping the tags and Articles and this is literally all the code that's needed to get a list of all your articles showing on on a site So it's fairly straightforward to work with It also supports writing back. You do need to kind of sort out a lot of the the issues around you know what we tend to do is make a copy of the the article in this case and flatten it so that we don't have the attributes to to iterate through and then we'll have We'll respond to changes that the user puts in the interface with with a watch and update our update a fresh copy of the object and then just put it back in the store and there's a method for doing that there's There's two. So this is all really straightforward easy for both read write create So if you router Aren't going as much into it, but it's definitely really useful if your object It needs to be aware of the page that it's on And so we use this a lot to kind of sync up and know Which objects to get on a particular page and that way you can have a button that is aware of what it is You can also Embed in your DOM element properties and treat it more like a web component and and pass those straight into your your components Path auto, you know and routing is Is something we really pay a lot of attention to already told you how we like text on any term trees Another thing another best practice that we've found is We will keep when you create pull in other interface projects. You'll end up with Different folders to put your components in everything's pretty much everything's a component We tend to use views use the views directory to put anything that's linked to a route And those tend to be more layout related components and then all the data binding ones Are end up in the components directory? And just some tips for organization will help you in In the long run another one that I recently was reading as a best practice is never use single word Names for your components always have multiple words to give it more context. It's a list. It's a view. It's a It's an item or whatever Was you're doing it? Um This is just scratching the surface we've looked at decoupled menus and that kind of comes underneath the the Jason API endpoints you can load a menu and get a link set back and And we played around with that a little bit and there's been a lot of talk here about it So it's exciting to see that progressing the PWA talk Yesterday well, I found really interesting and and and this you know This is kind of ready to go to bundle up and and add your web workers into your view project and just keep going View CLI does a bit more than just the command line It has a UI on top of it if you just type view UI It'll open up in a web browser and it remembers the projects on your computer and you can go and add other Other it's like a package manager for view Pull in a whole variety of related projects We we tend to use beautify a lot as a UI toolkit and that has a lot of things like tab controls and accordions And and a lot of really nice form elements. So we'll base things on that code splitting and layers It's that's another thing that we've figured out how to do is you can have multiple top level Components and in the main JS that bootstraps it you can split those out into different routes and View router will also help you do the layer splitting so that you end up with just the layers you need for the components You're loading on the page Well, that's multiple entry points as well Then you can add those in various various spots in the page View three has added a teleport as well so that you can basically take a particular component and bind it to a DOM element that's completely outside the main one so you can have one app and Shoot your components off to different parts of the page that aren't just in the main thing Well, I haven't had a chance to try it out yet, but that's that's that's another thing That's kind of on our radar I've got some Links here you can actually download the presentation. I've got a PDF version or single-page app version and I think I have that URL on the second slide, but it's freelock.com PVD I think and then So the the npm packages, there's a simple OAuth is useful for development the API documentation for Drupal is a really great starting point. There's a lot of examples in what you need to use there and and View X is a is another great place to start and I should be adding a bunch more from this week because there's a lot of other great resources here, too and That's basically it So at this point Take some questions. I do have a live example that I just put over on the umami Insta starter package if anybody wants to see it, but at this point I'll open it up for questions Yes No, we're not doing the question is that or is there hot module loading inside Drupal or just an outside development environment and No, we're not doing any in Drupal right now. We're just using the stock view setup so npm run serve and Your widget loads up and that's why we've kind of split the the targets for environments So we can get at the Drupal data and just work on the component standalone Yes Yeah, so the questions on SEO and whether how do you make sure that you get the content on the page for SEO? when you have it all wrapped in a view widget and We make heavy use of slots So we will inject on the DOM of the page you can insert other HTML inside it And so we end up having Drupal render the content for the search engine And then we have it linked to the routes in In view and so it can either just take that content as is and and render it using view components or If it needs to pull in other stuff I mean we've just basically make sure that all the searchable content is on the page with JavaScript turned entirely off and we make the the routes match between Drupal and view so that if you if you go To one of those inside pages on our puzzle for example You'll see all the text on the page in the in the source code, but it immediately bootstraps view and and loads its content and some of the related links and all that but all the images and it's on the The page that you the same page that that Drupal is serving essentially Yes, so I was at a boff yesterday I haven't done any of that we've we're using Drupal to render all the all the the content that we want for search engines and everything Drupal next though. I was talking to Sounds like is working pretty well for that doing the server side rendering automatically and it seems like there's a couple other Things out there as well Yes Yeah, yeah, and drugs. I think is the other the other one that's that's going down that path Yes, so Generic Drupal web components is the is the answer or at least one of the answers Yeah And I attended Brian's talk earlier and it's a great to hear You know we're trying to get as a community some standards going so that everybody doesn't have to reinvent the wheel we can all work together and make Like like everything in Drupal make one really good solution that works for everybody And you know there are questions Do you want to see more code or didn't take a look at any of that or we I? Can pull up some stuff and oh, yeah Well, so that'd be for the initial page load But if you're actually in your browser, you're not doing more page loads You you transition to the new route and it back fills just the data So and that way you can animate between your routes and do a bunch of really nice UX on that Yeah, if you were actually going page to page That would not be pretty Yes, I didn't catch all of that authentication using simple OAuth and yeah The simple OAuth side or the view X all of it. So yeah, so what we did and I like I said, I just I I don't know if I can really get the demo here, but basically it's install the simple OAuth module and then create a Create your private and public key. You'll need to set that up and then add a consumer Yeah, let me see if I can pull up my switch this to mirror Okay, thank you all for coming. I'll keep on answering questions for you