Topic Cloud / list all topics in an issue
  • Hi,

    is there somebody who could create a "topic" cloud?
    I need a solution which creates me a topic list of current issue (and tells me how often is this topic used in current issue).
    e.g.

    Summer,4,uri-to-search-all-tags-with-summer
    Winter,1,uri-to-search-all-tags-with-winter
    Spring,4,uri-to-search-all-tags-with-spring

    So the user can click on the topic Summer, and gets a list like "topic-cont.tpl" for the clicked topic.

    Best regards,
    Thomas. 
  • 10 Comments sorted by
  • Hi Thomas,

    --
    Ljuba Rankovic
    Senior Front End Developer, Sourcefabric
    ljuba.rankovic@sourcefabric.org

    http://www.sourcefabric.org
    http://www.twitter.com/Sourcefabric
  • This sounds pretty good, but I need to create a list list_article_topics with constraint to a specific issue.

    Which $gimme->topic->XXX shows the issue/section/article number of the specific topic?

    (I need an answer to: which topic has which articles).

    Best regards!
    Thomas.

  • Hello all,
    is there somebody who can help?

    Best regards,
    Thomas.
  • You can get list of articles that have specific topic(s) this way:

    {{ list_articles ignore_issue="true" ignore_section="true" constraints="topic is $topic1 topic is $topic2 matchalltopics" }}

    there is also option 'matchanytopic' available

    --
    Ljuba Rankovic
    Senior Front End Developer, Sourcefabric
    ljuba.rankovic@sourcefabric.org

    http://www.sourcefabric.org
    http://www.twitter.com/Sourcefabric
  • Hi ljuba,
    i tried to output this list, but it seems the list is empty. (But {{ list_article_topics }} shows me a list).
    How can I debug, why list_articles with constraint to topic is empty.

    I do following:


    {{* write all topics to an array *}}
            {{ list_article_topics }}
                    {{ $array[$gimme->topic->name]['id'] = $gimme->topic->id }}
                    {{ $array[$gimme->topic->name]['name'] = $gimme->topic->name }}
                    {{ $array[$gimme->topic->name]['count'] = $array[$gimme->topic->name]['count'] + 1 }}
            {{ /list_article_topics }}

    {{* show count of topics and articles with this topic *}}
            {{$count=0}}
            {{foreach from=$array item=item}}
            {{if $count == 0}}<p>{{ /if }}{{$count=$count+1}}
            <a href="{{ url options="template topic.tpl" }}&tpid={{$item['id']}}">{{$item['name']}}</a> ({{$item['count']}}){{ if $count == count($array) }}{{ else }}, {{ /if }}
                    {{ list_articles ignore_issue="false" ignore_section="true" constraints="topic is $item['name'] matchAnyTopic"}}
                            <h6>[{{$count}}]<a href="{{ $gimme->article->url }}" title="{{ $gimme->article->title }}">{{ $gimme->article->title }}</a></h6>

                    {{/list_articles}}
            {{/foreach}}<br />

    Any help is appreciated.

    Current Output is:

    Endpoint Security (1), IBM Tivoli (3), Security (1), Monitoring (1), Software (3), Mobile Device (1), Microsoft Windows (1), Linux (1), UNIX/AIX (1), Veranstaltungen (1), Events (1), Mitarbeiter (2), Partner (1), Backup/Recovery (1), HA (1), Loadbalancing (1)

    Best regards,
    Thomas.
    Post edited by BAUMANN Thomas at 2012-06-30 17:31:56
  • I am not sure but try to add lang parameter after the topic name here

    {{ list_articles ignore_issue="false" ignore_section="true" constraints="topic is $item['name']:de matchAnyTopic"}}

    --
    Ljuba Rankovic
    Senior Front End Developer, Sourcefabric
    ljuba.rankovic@sourcefabric.org

    http://www.sourcefabric.org
    http://www.twitter.com/Sourcefabric
  • The list shows still empty :-(
    How can I check further?

    I even did following (assign variable testtopic with a defined topic).

                    {{assign var=testtopic value="Partner"}}
                    {{ list_articles ignore_issue="false" ignore_section="true" constraints="topic is $testtopic  matchAnyTopic"}}
                           
    <h6>[{{$count}}]<a href="{{ $gimme->article->url }}"
    title="{{ $gimme->article->title }}">{{
    $gimme->article->title }}</a></h6>
                    {{/list_articles}}

    But nothing is printed :-(
    It seems there is something wrong with the constraints :-(

    Or can I use e.g. topicid as constraint? Which constraints are allowed?

    Best regards,
    Thomas.
  • Even trying from http://en.flossmanuals.net/newscoop-4-cookbook-en-4-0/template-reference--lists/list-articles-and-article-related-content/ to say

    {{ list_articles ignore_issue="true" ignore_section="true" constraints="topic not `Partner` matchAnyTopic"}}

    to get articles which dont have a topic "Partner"

    the list is still empty.
    When removing the constraint, then all articles are printed.
  • Hi,
    these are all possible constraints inside article list:

    • name <string_operator> <string_value>
    • number <integer_operator> <integer_value>
    • keyword <string_value>
    • OnFrontPage <switch_operator> <switch_value>
    • OnSection <switch_operator> <switch_value>
    • upload_date <date_operator> <date_value>
    • publish_date <date_operator> <date_value>
    • public <switch_operator> <switch_value>
    • type <switch_operator> <article_type>
    • <article_type> <article_type_attribute> <attribute_type_operator> <attribute_type_value>
    • matchAllTopics
    • matchAnyTopic
    • topic is|not <string_value>
    • reads <integer_operator> <integer_value>
    • author <string_operator> <string_value>
    • issue <integer_operator> <integer_value>
    • section <integer_operator> <integer_value>

    --
    Ljuba Rankovic
    Senior Front End Developer, Sourcefabric
    ljuba.rankovic@sourcefabric.org

    http://www.sourcefabric.org
    http://www.twitter.com/Sourcefabric
  • Reply to @BAUMANN+Thomas: can you provide login data so I can test?
    --
    Ljuba Rankovic
    Senior Front End Developer, Sourcefabric
    ljuba.rankovic@sourcefabric.org

    http://www.sourcefabric.org
    http://www.twitter.com/Sourcefabric