Changing the default SEO fileld setting when creating pages

In our settup right now, when you create a new page, and dose not set inte seo setting, Index is set to true and follow is set to false.

Can we somehow change the default to true on both fields?

Litium version: 7.4

1 Like

I don’t know about any setting you can set. But a guess is that you can create a new event that listens to “PageCreated”.
And in there set the field “_followLinks” to true.
(Not tested code)

eventBroker.Subscribe<PageCreated>(x => SetFollowLinks(x.Item));
private void SetFollowLinks(Page page)
    {
        using (_securityContextService.ActAsSystem("UpdateFollowLinks"))
        {
            var pageClone = page.MakeWritableClone();
            pageClone.Fields.AddOrUpdateValue("_followLinks", true);
            _pageService.Update(pageClone);
        }
    }
1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.