How to add custom meta tags and meta descriptions to News items
The News module seems to auto-generate a URL for each News Item based on the title of the item. Each item then inherits meta tags and meta description data from the parent page.
Is it possible to apply custom meta tag and meta description values at the New item level (i.e. is it possible to override the parent-page settings)?
Hi Sarah,
For Sitefintiy 4.0 we will have this feature out of the box. I believe that we will be able to introduce this feature for the BETA release.
For 3.x edition
You could create an additional metakey ( UserManual, page 219) and define the metakeys for each news item. When you open the item in single mode you will read this metakey and use HtmlMeta ASP.NET class to add the keys in the header collection.
You could create a custom control that inherits from NewsView. Then override SetSingleItemContent. you could access the IContent directly, because it is a parameter of the method. Then call GetMetaData() and read the value of the custom metakey you have already created. If the string is not empty use HtmlMeta class to add metadata.
All the best,
Ivan Dimitrov
the Telerik team
Do you have an example of this you could send me.
Hello Shaka,
You can add custom metakeys directly from the UI of each content module in Sitefinity 4.0.
Regards,
Ivan Dimitrov
the Telerik team
I am maintaining a customer's site that's using Sitefinity 3.7
Hello Shaka,
Please refer to our User Manual, Adding Custom Fields section.
All the best,
Ivan Dimitrov
the Telerik team
I am using a custom metafield to display the html title. But it displays the html title twice. This is how it's displayed in the browser...
This is the title of the page > This is the title of the page.
Before I started using the custom metafield, it displayed the main news page title and then the sub news article title as such...
This is the title of the main news page > This is the title of the news article page.
How do I only display only the news article title; without the divider ">" sign? Is there a setting I am overlooking?
The manual references the following files:
~/Sitefinity/Admin/ControlTemplates/News/NewsItemList.ascx
~/Sitefinity/Admin/ControlTemplates/News/App_LocalResources/NewsItemPreview.ascx.resx
~/Sitefinity/Admin/ControlTemplates/News/NewsItemPreview.ascx
None of these exist in my project. Do you know why that would be? I am on version 3.7.2136.2.
Hi ,
Have you checked the external templates?
Kind regards,
Ivan Dimitrov
the Telerik team
What are the steps to download the external templates?
Hi Shaka,
You can find a complete reference for all Views (controls) in the ControlsConfigReference.xml which you will find in ExternalTemplates.zip file. It can be downloaded from your Client.Net accounts. Note that you should download the templates needed for your version. Example:
Best wishes,
Ivan Dimitrov
the Telerik team
Yes, I read that on the link you posted. But how do you actually find the download on the site? How do you navigate to get there?
Hi,
You do not have active downloads and it is not possible to get the 3.x templates. Please use the account from which you downloaded Sitefinity to get the external templates.
Regards,
Ivan Dimitrov
the Telerik team
I can't figure out how to download the ExternalTemplates.zip. Where do I find the link download for my version?
Hi Will,
Here is a link to the download section
www.sitefinity.com/.../single-download.aspx
Regards,
Ivan Dimitrov
the Telerik team
Hi,
I have Sitefinity 4.0 and am trying to add custom meta tags for my news articles. I am able to create the custom fields, but am unable to make them appear in the <head> of the actual news article. I was thinking I could add the custom fields on the widget template for my single item news template... but there doesn't seem to be a way to make the tags appear in the <head> which is where they would need to go.
Specifically, I want to add the Facebook meta tags to the head section so that facebook will preview the articles correctly:
<meta property=”og:image” content=”url to image”/> <meta property=”og:title” content=”title of the page”/> <meta property=”og:site_name” content=”name of the site”/>
Hi Ryan,
You can use ASP.NET HtmlMeta class to add your tags.
All the best,
Ivan Dimitrov
the Telerik team
Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>
Hi Ivan,
Can you provide slightly more detail on how to accomplish this? I'm currently using 5.3. I would like to add custom meta tags for each news story.
Thanks!
Hi Amanda,
Sitefinity 5.4 offers such functionality out of the box, where you can configure a custom field from which the system can pull the meta description information for each content item. For previous versions I believe you might find this blog post useful.
Greetings,
Boyan Barnev
the Telerik team