New Archives and setting the template name template properties tab

anu menon asked on April 2, 2015 07:52

Hi All

I have copied the news archives from my old website to new website. But the new archives detail page is using the old template. How can I change the detail page of news archives all at once to new template.

Thanks in Advance

Recent Answers


Brenden Kehren answered on April 2, 2015 13:39

Create a new template OR if you're not concerned with how the "old" looks, modify the existing template.

0 votesVote for this answer Mark as a Correct answer

anu menon answered on April 2, 2015 13:47

I have created the new template but my question is I have around 500 news archives how can I update the template name of all these news at one shot to new template name

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on April 2, 2015 14:23

If you've used templates correctly, you should only need to make the modification on one of the pages and the others will be updated as well.

In most cases a news list/detail like that uses a simple page with a repeater that has a list transformation and a detail transformation. In this example the "detail" inherits the parent page template so if you update your list page and your transformations you should be good.

Now not knowing your setup, your scenario could be different and each news archive has it's own template or archive. If that's the case, I'd suggest creating a new setup as I described as it will take you a shorter amount of time than running through 500+ pages to update.

0 votesVote for this answer Mark as a Correct answer

anu menon answered on April 2, 2015 14:48

I had copied the all the news from the old site to our new site. So in each of these details page i can see the template name as SMD newsdetail, But I dont understand How can I update the details page template to new at a shot.

0 votesVote for this answer Mark as a Correct answer

Charles Matvchuk answered on April 2, 2015 16:02 (last edited on April 2, 2015 16:04)

I ran into this on my first import with the toolkit. You need to put the template in the new system. Then you need to get the TemplateID I usually just go look in the SQL Server table CMS_PageTemplate. Then when you perform the import click advanced in your field mappings and in the field DocumentPageTemplateID put the PageTemplateID. When you import it will assign the correct template to each.

Now if you already imported, you can go to the CMS_Document Table, write an update query that will just update the documents you wish to update in the CMS_PageTemplateID Field with the correct PageTemplateID. If you are going to update the sql table directly I recommend that you know and have an understanding of update queries and such.

Most likely in the query I would probably just use the class name as part of the criteria.

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on April 2, 2015 16:29

Charles solution is an option although I'd suggest against directly modifying the tables as suggested simply for data consistency and the possibility of missing something that could be unique in your setup.

Can you give a screenshot of your content tree and how the repeater or listing webpart is setup to display the news items? There's a good chance the news items are also using a preassigned page template at the page type level which you'd need to change as well. I'm guessing you don't have 500 different page templates for your news items so its really needing to understand what your setup is prior to making any changes.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.