Ability to modify page head section and html tag
Add ability to modify page head section and html tag from UI without need to modify PortalTemplate.aspx file.
We are currently exploring this idea and looking for the best solution.
To better understand all the related needs, I would like to ask you a few things:
1. Can you list the most typical changes you need to make to the page template and its head section?
2. Is it ok for you just to be able to modify the Master page or do you need to be able to somehow modify also common pages and their head sections – via their templates?
3. Do you prefer to be able to see and modify some markup directly or do think specific web parts with properties that are then injected into the markup are a better solution?
4. Who and how often is going to do these changes? The developer suring development phase or a content editor during content authoring process?
5. If we only talk about being able to edit the Master page from UI – do you think a solution where the “adminstrator” sets up available fields in PortalTemplate.aspx and others can then add values to the predefined fields from UI is viable?
Thanks in advance for comments!
Would definitely like this ability to edit the HTML tag so we can easily add a HREFLANG attribute to our HTTP header for localisation.
Dave Nelson commented
My burning need right now is Open Graph meta tags. Here is more information via Facebook, but keep in mind that the Open Graph tags are not just used by Facebook but also many other sites. https://developers.facebook.com/docs/sharing/webmasters
Sasha Shevelev commented
1. Open Graph, Twitter cards, Dublin Core tags.
2. this should be just an extension of the current meta tag editing functionality. Why would we want to do this in code?
3. Content admins and marketers should be able to add as many tags as they like. Viewing markup should be an extra option more for script injection code but simple tags should be easily added through a form type interface. Adding Google Analytics / mapping code should be manageable by the client. It exists in 100% of projects so why is it up to devs to implement?
4. Content editors. Why would you want devs anywhere near this? It's content.
5. As long as the tag values can be unique per page
To sum up. Copy the metatag editing functionality from WordPress. Once a client has used the WP one they ask why they cant do the same in Kentico - Not a good look.
Ralph Spandl commented
In our case, the only thing that was requested by SEO is inserting the lang attribute into the html tag. I usually prefer to set head content in Master page of if required in templates. Rarely use web parts for this scenario.
Ilesh Mistry commented
For me the HTML tag is really important to amend for Accessibility reasons when using the Portal Engine approach.
We need to be able to set the HTML Language, which we can't set without amending the PortalTemplate.aspx file.
We merged all suggestions related to modifying page head section and html tag into this idea. We want to address all the issues at once.
Sasha Shevelev commented
I'd like to add to this. I just started using version 8 and have the following improvements.
1. Increase the size of the text fields to enter the metadata.
2. Have a grid view where you can see all pages and enter all metadata without hing to jump from page to page.
3. Provide more help to basic users as in recommended lengths for metadata fields for Google optimisation.
4. Ability to add your own custom tags
Hi Jarrod, thank you for your suggestion. Master page tab in CMSDesk doesn't show final HTML output. For example some webparts can render their content into master page tags, so the HTML is there just to give you context, what you are editing. If you want full HTML control, you can use MVC or ASPX templates together with ASP.NET master pages.
Many customers report that they want more control over the HTML. We are planning some improvements in this area.
Hi, your request definitely makes sense. Is HTML tag sufficient? I know that you must add class "no-js" to provide fallback but I'm not too familiar with this library. Is there anything else what you might need to edit?
Currently we are doing this by adding the following code:
protected void Page_Init(object sender, EventArgs e)
BodyClass += " " + CMS.CMSHelper.CMSContext.ViewMode.ToString();
But as you know, this file might be overwritten by a hotfix/upgrade.