Change template page breaks the website

Posted by Community Admin on 04-Aug-2018 09:27

Change template page breaks the website

All Replies

Posted by Community Admin on 30-Nov-2012 00:00

Hi,

I had to change my template and I've created a new template based on the old one.

I changed my page template to "No Template" and tried to change it again to my new template but when I do this, I'm unable to edit the page.

To solve this problem, I have to remove the whole content and than I change the template and have to add everything again.

Is this a bug?

See attached files.

noTemplate.jpg - The content without template
noTemplateLayout.jpg - The content and the layout page without template
layoutbroken.jpg - the page is broken after changing the layout.

Regards,

Posted by Community Admin on 05-Dec-2012 00:00

Hello Rafael,

 Thanks for using Sitefinity!

No it's not a bug. When you swap templates out on an existing page it doesn't know where the content should go because the <asp:ContentPlaceHolder> are different. You'll notice if you swap templates out with matching IDs for placeholders that the widgets will fall into the placeholder they original resided in. Even in the images where you listed you didn't have a template, technically there is still a template there it is just a default template provided by Sitefinity. Those squares where you can drag and drop are still rendered ContentPlaceHolders so switching out templates would cause them to break. Also, it looks like you haven't applied a theme, this is also why your CSS elements are not lining up properly and it looks broken. To apply a theme you need to go to the template and in the top right you will see a button labeled "styles" from there you can specify your theme. To add a theme go to Administration > Advanced > Frontened Appearance and reference to the folders in your project.

I hope this helps. If you have any questions please let me know!

Kind regards,
Patrick Dunn
the Telerik team
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 07-Dec-2012 00:00

@ Dunn
I have the same problem and don't see how your advice would work.

See screenshot for more details

As you can see in the video. Going from 2 rows to 3 rows works perfect since the 2 row placeholder is still available. Going from 3 rows to 2 rows the content placeholder ends up at the top and there seem nothing I can do about it. In my memory I used to be able to grab it from there to move it. Is my memory wrong.

www.marktold.com/screencast/sf_template_change.swf

Markus

Posted by Community Admin on 11-Dec-2012 00:00

Hi Markus,

 The example provided was a discussion of moving from one template to a another template not based on each other. Your video demonstrates taking the same base template and changing the layout internally for it. When I do this on a fresh template the content appears in the first available placeholder when switched.

I have brought up how this is handled to our developers. If you have inputs on how you would like to see template changes occur with respect to content organization on the new template feel free to leave a response here and I will let them know.

Thank you!

Greetings,
Patrick Dunn
the Telerik team
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 11-Dec-2012 00:00

Dear Patrick

To me its absolutely clear that the content can not be put anywhere. 

The problem is, that at the moment the left over content is on top of the page and can not be dragged anywhere. I somehow have the feeling in the past I was able to drag left over content around.

Any confirmation on this.

Markus

Posted by Community Admin on 13-Dec-2012 00:00

Hi Markus,

I was not able to reproduce your error on a fresh installation of 5.2.3800.

Please see the screencast here http://www.screencast.com/t/Jc05Ffi8XDH

This leads me to believe it is something with your custom template. If you want you can open a support ticket, send us a copy of your template and theme, and we can see what's causing the problem.

Thank you in advance!

All the best,
Patrick Dunn
the Telerik team
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 13-Dec-2012 00:00

Dear Patrick

Did you base your 3 colum on the two column template.

Did you just add a new 50%/50% Layout region in the right half of the 2 column template?

Markus

Posted by Community Admin on 15-Dec-2012 00:00

Hello Markus,

 No, they were individually different, independent, templates. If you would like to send me yours in a ticket I would be more than happy to troubleshoot the issue for you.

Thanks in advance!

Kind regards,
Patrick Dunn
the Telerik team
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 18-Dec-2012 00:00

Dear Patrick

I don't think there is need for sending a project or opening a ticket.

Just take your 2 column teamplate and create a 3 colum templated based on this. Then add a 50/50 layout to the right column of the two colums temmplate placeholder.

Use the 3 column layout temmplate. add some content in all 3 columns, save and then switch to the two colum layouts.

Markus

Posted by Community Admin on 26-Sep-2013 00:00

I am having the same problem. After changing the page template, Sitefinity was putting the homeless content blocks up at the top of the page and I was getting JavaScript errors that were making all SF functionality crap out. SF was incapable of doing anything, including changing the template back to something else. 

I solved it by temporarily adding additional ContentPlaceholders into the new template to matching the IDs of the  CPs from the previous template. I loaded the Sitefinity page editor back up and deleted all content blocks in the new, temporary placeholders. Publish the page. Remove the temporary placeholders.

I'm pretty disappointed that Sitefinity would offer functionality that would allow users to shoot themselves in the feet. At least there is a workaround. It's not great (especially for production sites) but if you're quick, the temporary CPs would only be up for a couple minutes or less.  

Posted by Community Admin on 27-Sep-2013 00:00

Hi Jeff,

Thnak you for your feedback.

Please note that when changing the template, and opening the page for editing, if we cannot find the placeholder a widget's associated with, we need a mechanism to place it somewhere so you will be able to properly drag it in a location of your preference.
As the placeholders on a page may come from several locations - the masterpage, the template, and the page itself, the mechanism for combining and rendering them in the page edit screen, and ensuring that all widgets are ordered correctly is quite complex. A part of this mechanism is to place all "orphaned" widgets i.e. the ones that cannot find their placeholder, in the first available placeholder on the page.
Since the Sitefinity page edit supports only ContentPlaceHolders inside the<body> <form> tag, if your templates have been created through Sitefinity you're pretty much avoiding any problems of this sort. However if you're using a custom masterpage, whose HTML we cannot control, and have included a ContentPlaceHolder in the <head> tag, for example, this will be the first available placeholder on the page, and the "orphaned" widgets will be placed there. However, as this is at the same time a non supported location for our backed page editor, it would result in the described behavior.
Our advice would be to adhere to having your ContentPlaceHolders placed only withing the <body>
    <form> tag if you're using custom masterpages, to avoid similar problems in the future.

I hope you find this information useful. please let us know if any issues persist.

Regards,
Boyan Barnev
Telerik

Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 27-Sep-2013 00:00

@Jeff

I really think that the problems comes from .master pages created in VS which places a ContentPlaceHolder in the <head> tag.

a) You should remove this since this will overwrite the top part of the page you are editing -> You wont see the name of the page you are editing
b) You should remove it because then the problem should not exist and no shooting into foot
c) I usually ad an extra content placeholder at the bottom and so the client can move content there before switching templates


@Boyan

It might be a good idea if Sitefinity would move the content into the frist available ContentPlaceHolder in the body tag

Markus

This thread is closed