Ignore publication on dynamic map?
  • I want to show a map with locations from articles in all publications and not just the default one. There is no option for this in {{ set_map }}, so I tried using {{ unset_publication }}, but this creates a map without POIs. {{ unset_publication }} works for article lists but not in dynamic maps. How can I do this? This is the template: 

    {{ unset_publication }}
    {{ set_map
        label="Sverige"
        area_exact=false
        area="rectangle 69.0666667 10.9575; 55.3333333 24.1666667"
    }}

    {{ map
        show_locations_list=false
        show_reset_link=true
        area_show="focus"
        width="561"
        height="784"
    }}

    {{ list_articles length="10" ignore_issue="true" ignore_section="true" order="bypublishdate desc" location="69.0666667 10.9575, 55.3333333 24.1666667" constraints="type is news" }}

              <section class="art-item clearfix">
                    <header>
                          <h3><a href="{{ url options="article" }}">{{ $gimme->article->name }}</a></h3>
                            <p><span class="right">{{ include file="_tpl/article-icons.tpl" }}</span>Publicerad <time datetime="{{$gimme->article->publish_date|date_format:"%Y-%m-%dT%H:%MZ"}}">{{ $gimme->article->publish_date|camp_date_format:"%d %M %Y" }}</time> av {{ list_article_authors }}{{ if $gimme->author->user->defined }}<a href="{{ $view->url(['username' => $gimme->author->user->uname], 'user') }}">{{ /if }}{{ $gimme->author->name }}{{ if $gimme->author->user->defined }}</a>{{ /if }} ({{ $gimme->author->type|lower }}){{ if !$gimme->current_list->at_end }}, {{ /if }}{{ /list_article_authors }}</p>
                    </header>
                    {{ include file="_tpl/img/img_250x167.tpl" where="section" }}
                    <p>{{ include file="_tpl/_edit-article.tpl" }}{{ $gimme->article->deck }}</p>
                </section><!-- /.art-item -->
                
    {{ if $gimme->current_list->at_end }}            

    {{* PAGINATION *}}
    {{ $pages=ceil($gimme->current_list->count/10) }}
    {{ $curpage=intval($gimme->url->get_parameter($gimme->current_list_id())) }}
    {{ if $pages gt 1 }}
    <ul class="pagination">
        {{ if $gimme->current_list->has_previous_elements }}<li class="prev"><a href="{{ uripath }}?{{ urlparameters options="previous_items" }}">Nyare</a></li>{{ /if }}
        {{ for $i=0 to $pages - 1 }}
            {{ $curlistid=$i*10 }}
            {{ $gimme->url->set_parameter($gimme->current_list_id(),$curlistid) }}
            {{ if $curlistid != $curpage }}
        <li><a href="{{ uripath }}?{{ urlparameters }}">{{ $i+1 }}</a></li>
            {{ else }}
        <li class="selected"><a href="{{ uripath }}?{{ urlparameters }}">{{ $i+1 }}</a></li>
            {{ $remi=$i+1 }}
            {{ /if }}
        {{ /for }}
        {{ if $gimme->current_list->has_next_elements }}<li class="next"><a href="{{ uripath }}?{{ urlparameters options="next_items" }}">Äldre</a></li>{{ /if }}
    </ul>
    {{ $gimme->url->set_parameter($gimme->current_list_id(),$curpage) }}
    {{ /if }}

    {{ /if }} 
    {{ /list_articles }}  

    Post edited by Sebastian Olsson (2) at 2013-10-09 08:10:54
  • 2 Comments sorted by
  • Vote Up0Vote Down Martin SaturkaMartin Saturka
    Posts: 40Member, Sourcefabric Team
    Hi, Sebastian,
    maps were developed in a way that you can set many constraints inside a publication; though it is restricted to a single publication.

    You can put a jira ticket with a feature request for the 'publication' (un)setting.

  • Also, changing the publication with eg {{ set_publication identifier="1" }} shows locations from those articles, but the links in the map don't work because they point to the default publication. I have not looked at the source code, but my guess is that the article links on the POIs are created using {{ uri }} instead of {{ url }}. {{ uri }} can not link across publications. 

    Thank you for your reply, Martin. I will make a ticket and hopefully this constraint can be added to a coming version of Newscoop. In the meantime, I will make all links to this template go to the publication with most articles.
    Post edited by Sebastian Olsson (2) at 2013-10-09 10:25:38