Example #1
0
    public static string GetTermsByFormat(TermTypes termType, int objectId, int count, string format)
    {
        List <BSTerm> terms = objectId != 0 ? GetTermsByObjectID(objectId, termType) : GetTerms(termType, count);

        string html = String.Empty;

        if (terms.Count > 0)
        {
            foreach (BSTerm term in terms)
            {
                if (format.Contains("{2}"))
                {
                    html += String.Format(format, BSHelper.GetPermalink("Tag", term.Code, Blogsa.UrlExtension), term.Name, term.Objects.Count);
                }
                else
                {
                    html += String.Format(format, BSHelper.GetPermalink("Tag", term.Code, Blogsa.UrlExtension), term.Name);
                }
            }
        }
        else
        {
            html = Language.Get["NoTag"];
        }
        return(html);
    }
    public string GetCategoriesHtml()
    {
        List <BSTerm> categories = GetCategories();
        string        html       = String.Empty;

        if (categories.Count > 0)
        {
            foreach (BSTerm category in categories)
            {
                html += "<a href=\"" + BSHelper.GetPermalink("Category", category.Code, Blogsa.UrlExtension) + "\">"
                        + category.Name + "</a> ";
            }
        }
        else
        {
            html = Language.Get["NoCategory"];
        }
        return(html);
    }