- Steve McNiven
Changing a sitefinity control view something really easy to do, we just need to get a current copy ascx control, move things around, then point the contol templateview over to our new file. Which is just telling sitefinity to use our version instead of it’s embedded one.
First thing you want to do is go download your version of the Sitefinity External Templates from your Client.net account at https://www.sitefinity.com. Once you have the templates, extract the zip and find the view you want to modify.
For this example, we’re going to use the blog templates.
The control which shows all the blog items on the page is the one named ContentViewItemList.ascx. You’ll notice that it’s just a couple repeater controls referencing a resource file. The first repeater is the one we want to deal, with as that’s what’s going to be displaying the blog entries.
You can see where it’s inserting the Generic Blog content inside the pnlPostContent Panel control. I normally leave this alone and go about moving the other items below it around. However you should be careful of deleting some of the controls, I think the backend trys to reference the ID of a control on the page which doesn’t exist. To be safe, just set their visibility or display to false or none respectivly.
…time passes as we modify the flow of the data…
- Ok, now in page edit mode, edit the BlogPosts control you’ve dropped onto your page
- Click the Advanced Tab
- Locate the Appearance Section and expand it
- You want to look for the items that end with “TemplatePath”
- Click the selector beside it and find the template file you’ve uploaded. I would highly recommend not putting it under the Sitefinity root folder to avoid confusion dring upgrades
- Save-up, Publish, and then spend the next few minutes tweaking the css