Webiant Logo Webiant Logo
  1. No results found.

    Try your search with a different keyword or use * as a wildcard.

NopSeoDefaults.cs

using Nop.Core.Caching;

namespace Nop.Services.Seo;

/// 
/// Represents default values related to SEO services
/// 
public static partial class NopSeoDefaults
{
    /// 
    /// Gets a max length of forum topic slug name
    /// 
    /// For long URLs we can get the following error: 
    /// "the specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters", 
    /// that's why we limit it to 100
    public static int ForumTopicLength => 100;

    /// 
    /// Gets a max length of search engine name
    /// 
    /// For long URLs we can get the following error: 
    /// "the specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters", 
    /// that's why we limit it to 200
    public static int SearchEngineNameLength => 200;

    /// 
    /// Gets a default list of slugs (seName) reserved for some other needs
    /// 
    public static List ReservedUrlRecordSlugs =>
    [
    //routes that redirected customers to the specific actions
    "admin",
    "blog",
    "boards",
    "cart",
    "checkout",
    "clearcomparelist",
    "compareproducts",
    "contactus",
    "emailwishlist",
    "install",
    "login",
    "logout",
    "multi-factor-verification",
    "newproducts",
    "news",
    "onepagecheckout",
    "page-not-found",
    "passwordrecovery",
    "privatemessages",
    "profile",
    "recentlyviewedproducts",
    "register",
    "search",
    "sitemap",
    "storeclosed",
    "wishlist",
    ];

    #region Sitemap

    /// 
    /// Gets a date and time format for the sitemap
    /// 
    public static string SitemapDateFormat => @"yyyy-MM-dd";

    /// 
    /// Gets a max number of URLs in the sitemap file. At now each provided sitemap file must have no more than 50000 URLs
    /// 
    public static int SitemapMaxUrlNumber => 50000;

    /// 
    /// Gets the name of the sitemap directory
    /// 
    public static string SitemapXmlDirectory => "sitemaps";

    /// 
    /// Gets a pattern to build sitemap filename
    /// 
    /// 
    /// {0} : store Id
    /// {1} : language Id
    /// {0} : sitemap index
    /// 
    public static string SitemapXmlFilePattern => "sitemap-{0}-{1}-{2}.xml";

    #endregion

    #region Caching defaults

    /// 
    /// Gets a key for caching
    /// 
    /// 
    /// {0} : entity ID
    /// {1} : entity name
    /// {2} : language ID
    /// 
    public static CacheKey UrlRecordCacheKey => new("Nop.urlrecord.{0}-{1}-{2}");

    /// 
    /// Gets a key for caching
    /// 
    /// 
    /// {0} : slug
    /// 
    public static CacheKey UrlRecordBySlugCacheKey => new("Nop.urlrecord.byslug.{0}");

    /// 
    /// Gets a key for caching
    /// 
    public static CacheKey UrlRecordSlugLookupCacheKey => new("Nop.urlrecord.sluglookup");

    /// 
    /// Gets a key for caching
    /// 
    /// 
    /// {0} : language ID
    /// 
    public static CacheKey UrlRecordEntityIdLookupCacheKey => new("Nop.urlrecord.entityidlookup.{0}");

    #endregion
}