仿站咨询QQ:2587483189

手机微信同号:15850888840

动易Cms解答自定义循环列表显示标题颜色、加粗等属性的问题

问题:自定义循环列表如何显示标题颜色、加粗等属性?

仿站解决:

默认自定义列表是不能显示标题字体颜色等属性的。可以通过修改源代码来实现。

在include文件夹的Powereasy.Common.Front.asp这个文件里面有这样一个函数

Function GetInfoList_GetStrTitle(Title, TitleLen, TitleFontType, TitleFontColor)

这个函数就是获取到对应文章的标题颜色,字体等属性,然后返回相应的html代码。

我们可以在自定义循环列表的代码里面调用一下这个函数来实现我们的目的:

打开include文件夹的Powereasy.Article.asp,找到2352行左右的Private Function GetCustomFromLabel(strTemp, strList)函数

找到下面的代码If TitleLen > 0 Then
            strTemp = PE_Replace(strTemp, "{$Title}", GetSubStr(rsCustom("Title"), TitleLen, ShowSuspensionPoints))
        Else
            strTemp = PE_Replace(strTemp, "{$Title}", rsCustom("Title"))
        End If

 

 

将这段代码改成

        If TitleLen > 0 Then
            strTemp = PE_Replace(strTemp, "{$Title}", GetInfoList_GetStrTitle(rsCustom("Title"), TitleLen, rsCustom("TitleFontType"), rsCustom("TitleFontColor")))
        Else
            strTemp = PE_Replace(strTemp, "{$Title}", GetInfoList_GetStrTitle(rsCustom("Title"), 0, rsCustom("TitleFontType"), rsCustom("TitleFontColor")))
        End If

 

因为这里我们需要用到字体颜色,字体类型两个字段,所以我们还要修改一下SQL语句,加入这两个字段。

还是找到这个函数的

    sqlCustom = sqlCustom & "A.ArticleID,A.ChannelID,A.ClassID,A.Title,A.Subheading,A.Keyword,A.Intro,A.DefaultPicUrl"

替换成

    sqlCustom = sqlCustom & "A.ArticleID,A.ChannelID,A.ClassID,A.Title,A.TitleFontType,A.TitleFontColor,A.Subheading,A.Keyword,A.Intro,A.DefaultPicUrl"

保存文件之后就应该可以看到效果了。

  • 上一篇:动易Cms解决网站乱码的方法
  • 下一篇:动易Cms怎样删除已经生成html的网页
  • 来源:51仿站//所属分类: 动易仿站 /更新时间:2010-08-30
    相关仿站教程