Developer forum

Forum » Swift » Custom Swift_Master and Swift_Page template not working

Custom Swift_Master and Swift_Page template not working

Tina Engelsen Pedersen
Reply

Im working on a swift solution for a customer, and made a copy of the Swift_Master and Swift_Page templates to do some changes. I added the new page template in website settings, but it still shows the old swift:page and swift_master template on the website. 

I tested it on our swift demo solution, and can see it's the same problem here. 

Is this a general problem in Swift solutions?


Replies

 
Tina Engelsen Pedersen
Reply

We have tried to restart the website to seer if it's a caching issue, but it didn't solve the problem. 

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Tina,

Try to delete the content of the_parsed folder.

Adrian

 
Tina Engelsen Pedersen
Reply

I have tried both to delete the content in the _parsed folder and recycling the website, but it still wont use the custom page and master template. Even though i have chosen the custom page template in layout, i also have to choose the custom template on the item page layouts for it to use it. 

 
Nicolai Pedersen
Reply

Hi Tina

I took the liberty of hijacking your demo site and selecting your custom template at website settings:

And it works fine in the page (in the bottom of the paragraph list you can see this):

So cannot recreate that particular issue.

That said, I have a question.

Why would you want to change the master and the page templates? It can be 'expensive' going forward on the solution to have these 2 critical templates custom.

  • The <head> section of the default master can be extended using the "Custom header include" feature on website settings
  • The header and the footer of the page is created using the visual content builder and the grids, and custom rows and columns can be added without touching the master/page templates
  • All content can be changed by adding custom columns (and rows if needed),

We would like to understand why you need to do this - if there is a missing extensibility point we would like to understand it.

Thank you for clarifying.

 
Tina Engelsen Pedersen
Reply

Hi Nicolai

I had to add the custom page template in "Item page layouts" on page as well as choose it as the layout template in website settings. It didn't work to just choose it as the layout, even though i recycled the site by adding a temporary host header. 

We are working on a customer website, that i can't post here, but i made a custom master with a to top link so it appears on all pages of the website. We haven't changed anything else, so it should still be fairly easy to update it when new swift versions are available.

i tried to add a feature with an anchor link to #content in the footer, but when i save, it changes the anchor link to http://#content, and therefore, it doesn't work: 


I made this variable for the to top link: 

var totopUrl = HttpContext.Current.Request.Url.Scheme + "://" + HttpContext.Current.Request.Url.Host + HttpContext.Current.Request.RawUrl.ToString() + "#content";

 
Tina Engelsen Pedersen
Reply

Hi Nicolai

On our demo swift site, i have changed the layout on website settings back to the standard swift page: https://tinyurl.com/yapmjbye

However, when i look at the template "Forside", it still uses the Custom_Swift_Page.cshtml template: https://tinyurl.com/ydb7dp7q

I have tried deleting the files in the _parsed folder and recycling the solution.

 

You must be logged in to post in the forum