1. 论坛系统升级为Xenforo,欢迎大家测试!
    排除公告

【分享】EE的TAGS插件~~~~~~···

本帖由 beiduo2007-12-26 发布。版面名称:源码讨论

  1. beiduo

    beiduo New Member

    注册:
    2005-11-09
    帖子:
    186
    赞:
    0
    EE有一个很著名的Tag Module,但是40美元的价格令人望而却步

    不过免费的有一款,Simple Tags,用WP的人也许会很耳熟:):):),EE也有一款

    不知道功能是不是一样的,不过应付普通的TAG的功能应该不会有问题吧:sweat::sweat:

    全都是洋文看得很迷糊~~~~~~只有哪天有了空间之后再尝试了:cry::cry:

    下载地址: http://www.opl.de/images/uploads/simple_tags.zip
     
  2. beiduo

    beiduo New Member

    注册:
    2005-11-09
    帖子:
    186
    赞:
    0
    This extension-/module-combination is intended for tagging weblog entries.
    Simple as in basic.
    There really are no bells & whistles or shiny interfaces. Any custom field can be designated as a field containing comma-separated tags. When posting, updating or deleting an entry the tagging database table is updated accordingly.
    If you happen to already have such a field, e.g. used for <meta name="keywords"> or the like, you can also re-index all your existing entries without the need to update them bit by bit.
    Tags as in informally assigning relevant keywords or phrases to entries and being able to use this information to access them.
    This version only supports tagging by the authors, not by your visitors. Currently there are no plans to change this.

    Installation

    1. Unzip the file.
    2. Upload the file ext.simple_tags.php to the extensions-folder inside your EE system directory.
    3. Upload the folder simpletag and the contained files to the modules-folder inside your EE system directory.
    4. Upload the files lang.simple_tags.php & lang.simpletag.php to the language/english-folder inside your EE system directory.
    5. In your Control Panel navigate to CP Home › Admin › Utilities › Extensions Manager, find the Simple Tags extension and click Enable?
    6. Now you have access to the Settings of the extension.
      There you’ll find a list of all Custom Weblog Fields that currently exist. You are supposed to select the field(s) that will contain your tags.

      [​IMG]
      If you have no field for this purpose yet, first create one, then come back here to activate it. Field Types can be Text Input or Textarea and Default Text Formatting must be ‘None’. Of course that field(s) must belong to the Field Group(s) assigned to the weblog(s) where you want to use tagging.
    7. In your Control Panel navigate to CP Home › Modules, find the Simple Tag module and click Install.
    8. Now you have access to the CP Interface of the module. There isn’t much to do there except batch-(re-)indexing all your existing weblog entries.
      If you installed the extension and already had a field containing comma-separated tags or if you at some point import entries that have such a field, the tagging-database table needs to be rebuild before the tags are available.
      This is as complicated as clicking the only button available until it’s gone [​IMG]
    Usage

    As has been mentioned before, in order to use tagging in a weblog the weblog’s Field Group must contain a Custom Weblog Field with Formatting set to None and this field must designated as a tagging field in the extension’s settings.
    When posting an entry you may enter your tags into that field. Separate the tags by commas.
    Taglist

    First thing you probably want to do is creating a template on which all related entries are shown once someone clicks on a Tag-link. I will call it site/taglist in this example.
    Inside this template you can use a pretty standard exp:weblog:entries-tag to display whatever you like of the related entries, but you’ll have to wrap it inside {exp:simpletag:taglist}{/exp:simpletag:taglist}.
    This tag has two parameters.

    tagname="{segment_3}"
    This parameter is mandatory. The Tag’s name will be passed in the URL. You have to specify the segment which contains it. Normally this will be the third segment.

    weblog="blog|news"
    This parameter is optional. If you want to limit the display to entries of (a) particular weblog(s) you can specifiy this here using the usual syntax.

    Important: You have to add the parameter entry_id="{tagged_entries}” to the enclosed exp:weblog:entries-tag.
    Example:

    {exp:simpletag:taglist weblog="{my_weblog}" tagname="{segment_3}"}
    {exp
    :weblog:entries entry_id="{tagged_entries}" limit="10" orderby="date" sort="desc"}
    <h1>{title}</h1>
    {summary} <a href="{title_permalink=site/article}">read more</a>
    {/exp:weblog:entries}
    {
    /exp:simpletag:taglist}

    To account for special characters tags use url_titles much like weblog entries or categories. If you want to print the plain text of the tagname there’s {exp:simpletag:tagheader}{/exp:simpletag:tagheader}.
    It has one mandatory parameter and a single variable: {tag}.

    tagname="{segment_3}"

    Example:

    {exp:simpletag:tagheader tagname="{segment_3}"}
    Taglist
    for {tag}
    {
    /exp:simpletag:tagheader}
    This will translate segment 3 into the plain text tagname.
    Listing Tag-links for each entry

    To display tags under your entries that are linked to the taglist we created above you can wrap {exp:simpletag:taggify}{/exp:simpletag:taggify} around the variable of the custom field you designated to contain tags. This may be done everywhere you display weblog entries with the exp:weblog:entries-tag no matter whether it’s on a single- or multi-entry template.
    There are two parameters.

    path=""
    This parameter is mandatory. This will contain the URL to the taglist we created. You can use a {path}-variable here.

    delimiter=""
    Optional. This can be any text-string you want to display between the single tags. If nothing is specified it defaults to one space character.
    Notice: Since a parameter cannot start or end with a space character, you have to use an underscore (_) instead if your delimiter shall begin or end with blanks.
    Example:

    {exp:weblog:entries weblog="blog" limit="10"}
    <h1>{title}</h1>
    {body}
    <br />
    Tags:
    {exp:simpletag:taggify path="{path=site/taglist}" delimiter="_-_"}
    {keywords}
    {
    /exp:simpletag:taggify}
    {
    /exp:weblog:entries}
    This will display the tags from your field named keywords separated by “ - “ and linked to the taglist-template.
    Displaying a tag-cloud

    Finally there is an EE-tag to display a tagcloud: {exp:simpletag:tagcloud}. It’s a single EE tag with no closing element.
    There are five parameters.

    path=""
    This parameter is mandatory. This will contain the URL to the taglist we created. You can use a {path}-variable here.

    weblog="blog|news"
    This parameter is optional. If you want to limit the display to entries of (a) particular weblog(s) you can specifiy this here using the usual syntax.

    limit="X"
    Optional. This limits the cloud to the X most popular tags.

    font_max=""
    Optional. The font-size of the tags will be determined in %. This is the maximum size a popular tag can reach. Defaults to 250.

    font_min=""
    Optional. The font-size of the tags will be determined in %. This is the minimum size an unpopular tag can reach. Defaults to 100.
    Example:

    {exp:simpletag:tagcloud font_max="200" limit="20" path="{path=site/taglist}"}
    This will produce a tagcloud with the top 20 tags linked to the template site/taglist and the most popular tag will have a font-size of 200%.
    That’s it.

    Hopefully it wasn’t too confusing to give it a try
     
  3. beiduo

    beiduo New Member

    注册:
    2005-11-09
    帖子:
    186
    赞:
    0
  4. deadfire

    deadfire New Member

    注册:
    2007-11-13
    帖子:
    621
    赞:
    0
    谢谢你告诉大家这个,哈,真棒。

    为啥不在本地单机上装了试验试验呢?
     
  5. beiduo

    beiduo New Member

    注册:
    2005-11-09
    帖子:
    186
    赞:
    0
    我在做模板,等模板做好了过年休假再研究
     
  6. beiduo

    beiduo New Member

    注册:
    2005-11-09
    帖子:
    186
    赞:
    0
    试了一下
    感觉很不好用

    TAG的链接是出来了,但是每篇文章只有一个TAG
    而且点击进去后没办法列出该TAG所索引的内容

    也许是偶太笨了或者看不大懂英文吧

    对了,那个Extensions Manager,指的是“扩充信息”(laogui的翻译版),好诡异的翻译啊,偶找了半天才找到

    希望有达人可以研究一下

    不过现在用EE的人貌似很少.............
     
  7. deadfire

    deadfire New Member

    注册:
    2007-11-13
    帖子:
    621
    赞:
    0
    我在使用研究了,不过研究进度缓慢,每天也就了解一点点。系统本身还没了解到多少,插件就要等更以后的时间才能接触到了,你演技出啥来别忘了和大家一起分享呀。

    老鬼要是能给大家也来个讲座就好了。
     
  8. beiduo

    beiduo New Member

    注册:
    2005-11-09
    帖子:
    186
    赞:
    0
    算了偶决定放弃EE了:cry::cry::cry:
     
  9. deadfire

    deadfire New Member

    注册:
    2007-11-13
    帖子:
    621
    赞:
    0
    为啥啊?别放弃啊,我刚刚开始准备仔细研究了呢,你就又打算放弃了。

    坚持还是不坚持,是个问题。

    看看,都弄了好几天了,不过一直比较菜,没啥实质性的内容。 http://www.cnite.net/ee/