print button on news detail page
Hi,
is there a way I can add a print button on the detail page after the user clicked to read the news article?
The print button is only gonna be used to print out the article and I only want it on the detail page (the full story of the article).
I'm new to sitefinity and using 4.3.
Any help is appreciated.
Hi Magnus,
This can be done very easily by changing the template to the NewsWidget. Firstly, you can create a new .ascx control, copying the details template for the NewsWidget and adding a button to it. The default template can either be found in Sitefinity's Backend >> Design >> WidgetTemplates or inside your SDK's folders (SDK\Content\Resources\WidgetTemplates.rar). Then, after adding the button to the template, in your .ascx control's codebehind, you can write the code that does the printing on Button_click. The new template can be registered by clicking Edit button of the News Widget, then ControlDefinition > Views >NewsFrontendDetails,
then delete the TemplateKey and in TemplatePath specify a virtual path to your user control (~/folder1/folder2/yourControl.ascx, where "~" is the root of your application).
Hope this helps. Please let me know if you have further questions on this.
Thanks Svetoslav, it helps a lot.