Display a list of blog posts that are filtered by tag, year, month,
    author or category. Custom templates are checked for using the name
    ``blog/blog_post_list_XXX.html`` where ``XXX`` is either the
    category slug or author's username if given.
192017
def blog_post_list(request, tag=None, year=None, month=None, username=None,
                   category=None, template="blog/blog_post_list.html",
                   extra_context=None):
    
    templates = []
    blog_posts = BlogPost.objects.published(for_user=request.user)
    if tag is not None:
        tag = get_object_or_404(Keyword, slug=tag)
        blog_posts = blog_posts.filter(keywords__keyword=tag)
    if year is not None:
        blog_posts = blog_posts.filter(publish_date__year=year)
        if month is not None:
            blog_posts = blog_posts.filter(publish_date__month=month)
            try:
                month = _(month_name[int(month)])
            except IndexError:
                raise Http404()
    if category is not None:
        category = get_object_or_404(BlogCategory, slug=category)
        blog_posts = blog_posts.filter(categories=category)
        templates.append(u"blog/blog_post_list_%s.html" %
                          str(category.slug))
    author = None
    if username is not None:
        author = get_object_or_404(User, username=username)
        blog_posts = blog_posts.filter(user=author)
        templates.append(u"blog/blog_post_list_%s.html" % username)

    prefetch = ("categories", "keywords__keyword")
    blog_posts = blog_posts.select_related("user").prefetch_related(*prefetch)
    blog_posts = paginate(blog_posts, request.GET.get("page", 1),
                          settings.BLOG_POST_PER_PAGE,
                          settings.MAX_PAGING_LINKS)
    context = {"blog_posts": blog_posts, "year": year, "month": month,
               "tag": tag, "category": category, "author": author}
    context.update(extra_context or {})
    templates.append(template)
    return TemplateResponse(request, templates, context)
48866
def filter_by_name_or_id_or_tag(self, query_string, queryset = None):
        
        assert self.Model.NAME_FIELD, \
            'NAME_FIELD is missing on model %s' % self.Model.__name__
        assert self.Model.ID_FIELD, \
            'ID_FIELD is missing on model %s' % self.Model.__name__
        assert self.Model.TAG_FIELD, \
            'TAG_FIELD is missing on model %s' % self.Model.__name__

        filter_args = {}
        name, uuid, tag = self._parse_as_name_or_id_or_tag(query_string)
        if name is not None:
            filter_args[self.Model.NAME_FIELD] = name
        if uuid is not None:
            filter_args[self.Model.ID_FIELD+'__startswith'] = uuid
        if tag is not None:
            filter_args[self.Model.TAG_FIELD] = tag
        if queryset is None:
            queryset = self.Model.objects.all()
        return queryset.filter(**filter_args)
562578
def create_blog_pages(self, posts, blog_index, *args, **options):
        """"""
        for post in posts:
            post_id = post.get('ID')
            title = post.get('title')
            if title:
                new_title = self.convert_html_entities(title)
                title = new_title
            slug = post.get('slug')
            description = post.get('description')
            if description:
                description = self.convert_html_entities(description)

            body = post.get('content')
            if not "<p>" in body:
                body = linebreaks(body)

            # get image info from content and create image objects
            body = self.create_images_from_urls_in_content(body)

            # author/user data
            author = post.get('author')
            user = self.create_user(author)
            categories = post.get('terms')
            # format the date
            date = post.get('date')[:10]
            try:
                new_entry = BlogPage.objects.get(slug=slug)
                new_entry.title = title
                new_entry.body = body
                new_entry.owner = user
                new_entry.save()
            except BlogPage.DoesNotExist:
                new_entry = blog_index.add_child(instance=BlogPage(
                    title=title, slug=slug, search_description="description",
                    date=date, body=body, owner=user))
            featured_image = post.get('featured_image')
            if featured_image is not None:
                title = post['featured_image']['title']
                source = post['featured_image']['source']
                path, file_ = os.path.split(source)
                source = source.replace('stage.swoon', 'swoon')
                try:
                    remote_image = urllib.request.urlretrieve(
                        self.prepare_url(source))
                    width = 640
                    height = 290
                    header_image = Image(title=title, width=width, height=height)
                    header_image.file.save(
                        file_, File(open(remote_image[0], 'rb')))
                    header_image.save()
                except UnicodeEncodeError:
                    header_image = None
                    print('unable to set header image {}'.format(source))
            else:
                header_image = None
            new_entry.header_image = header_image
            new_entry.save()
            if categories:
                self.create_categories_and_tags(new_entry, categories)
            if self.should_import_comments:
                self.import_comments(post_id, slug)
529681
def api_ebuio_forum_get_topics_by_tag_for_user(request, key=None, hproPk=None, tag=None, userPk=None):
    """"""

    # Check API key (in order to be sure that we have a valid one and that's correspond to the project
    if not check_api_key(request, key, hproPk):
        return HttpResponseForbidden

    if settings.PIAPI_STANDALONE:
        return HttpResponse(json.dumps({'error': 'no-on-ebuio'}), content_type="application/json")

    # We get the plugit object representing the project
    (_, _, hproject) = getPlugItObject(hproPk)

    # We get the user and we check his rights
    author_pk = request.GET.get('u')
    if author_pk and author_pk.isdigit():
        try:
            from users.models import TechUser

            user = TechUser.objects.get(pk=author_pk)
        except TechUser.DoesNotExist:
            error = 'user-no-found'
            user = generate_user(mode='ano')
    else:
        user = generate_user(mode='ano')

    if not hproject.discuss_can_display_posts(user):
        return HttpResponseForbidden

    # Verify the existence of the tag
    if not tag:
        raise Http404

    # We get the posts (only topics ones-the parent) related to the project and to the tag.
    # We dont' take the deleted ones.
    from discuss.models import Post

    posts = Post.objects.filter(is_deleted=False).filter(object_id=hproPk).filter(tags__tag=tag).order_by('-when')

    # We convert the posts list to json
    posts_json = [
        {'id': post.id, 'link': post.discuss_get_forum_topic_link(), 'subject': post.title, 'author': post.who_id,
         'when': post.when.strftime('%a, %d %b %Y %H:%M GMT'), 'score': post.score,
         'replies_number': post.direct_subposts_size()} for post in posts]

    return HttpResponse(json.dumps({'data': posts_json}), content_type="application/json")
808447
function query_posts()
   	{
   		// vars
   		$r = array(
   			'next_page_exists' => 1,
   			'html' => ''
   		);
   		
   		
   		// options
		$options = array(
			'post_type'					=>	'all',
			'taxonomy'					=>	'all',
			'posts_per_page'			=>	10,
			'paged'						=>	1,
			'orderby'					=>	'title',
			'order'						=>	'ASC',
			'post_status'				=>	'any',
			'suppress_filters'			=>	false,
			's'							=>	'',
			'lang'						=>	false,
			'update_post_meta_cache'	=>	false,
			'field_key'					=>	'',
			'nonce'						=>	'',
			'ancestor'					=>	false,
		);
		
		$options = array_merge( $options, $_POST );
		
		
		// validate
		if( ! wp_verify_nonce($options['nonce'], 'acf_nonce') )
		{
			die();
		}
		
		
		// WPML
		if( $options['lang'] )
		{
			global $sitepress;
			
			if( !empty($sitepress) )
			{
				$sitepress->switch_lang( $options['lang'] );
			}
		}
		
		
		// convert types
		$options['post_type'] = explode(',', $options['post_type']);
		$options['taxonomy'] = explode(',', $options['taxonomy']);
		
		
		// load all post types by default
		if( in_array('all', $options['post_type']) )
		{
			$options['post_type'] = apply_filters('acf/get_post_types', array());
		}
		
		
		// attachment doesn't work if it is the only item in an array???
		if( is_array($options['post_type']) && count($options['post_type']) == 1 )
		{
			$options['post_type'] = $options['post_type'][0];
		}
		
		
		// create tax queries
		if( ! in_array('all', $options['taxonomy']) )
		{
			// vars
			$taxonomies = array();
			$options['tax_query'] = array();
			
			foreach( $options['taxonomy'] as $v )
			{
				
				// find term (find taxonomy!)
				// $term = array( 0 => $taxonomy, 1 => $term_id )
				$term = explode(':', $v); 
				
				
				// validate
				if( !is_array($term) || !isset($term[1]) )
				{
					continue;
				}
				
				
				// add to tax array
				$taxonomies[ $term[0] ][] = $term[1];
				
			}
			
			
			// now create the tax queries
			foreach( $taxonomies as $k => $v )
			{
				$options['tax_query'][] = array(
					'taxonomy' => $k,
					'field' => 'id',
					'terms' => $v,
				);
			}
		}
		
		unset( $options['taxonomy'] );
		
		
		// load field
		$field = array();
		if( $options['ancestor'] )
		{
			$ancestor = apply_filters('acf/load_field', array(), $options['ancestor'] );
			$field = acf_get_child_field_from_parent_field( $options['field_key'], $ancestor );
		}
		else
		{
			$field = apply_filters('acf/load_field', array(), $options['field_key'] );
		}
		
		
		// get the post from which this field is rendered on
		$the_post = get_post( $options['post_id'] );
		
		
		// filters
		$options = apply_filters('acf/fields/relationship/query', $options, $field, $the_post);
		$options = apply_filters('acf/fields/relationship/query/name=' . $field['_name'], $options, $field, $the_post );
		$options = apply_filters('acf/fields/relationship/query/key=' . $field['key'], $options, $field, $the_post );
		
		
		// query
		$wp_query = new WP_Query( $options );

		
		// global
		global $post;
		
		
		// loop
		while( $wp_query->have_posts() ) {
			
			$wp_query->the_post();
			
			
			// get title
			$title = $this->get_result($post, $field, $the_post, $options);
			
			
			// update html
			$r['html'] .= '<li><a href="' . get_permalink($post->ID) . '" data-post_id="' . $post->ID . '">' . $title .  '<span class="acf-button-add"></span></a></li>';
				
		}
		
		
		// next page
		if( (int)$options['paged'] >= $wp_query->max_num_pages ) {
			
			$r['next_page_exists'] = 0;
			
		}
		
		
		// reset
		wp_reset_postdata();
		
		
		// return JSON
		echo json_encode( $r );
		
		die();
			
	}
65513
public function tag()
    {
        if (!appSetting('tags_enabled', 'blog-' . $this->oBlog->id) || !$this->uri->rsegment(4)) {

            show404();
        }

        // --------------------------------------------------------------------------

        //  Get tag
        $this->data['tag'] = $this->blog_tag_model->getBySlug($this->uri->rsegment(4));

        if (!$this->data['tag']) {

            show404();
        }

        // --------------------------------------------------------------------------

        //  Widgets
        $this->fetchSidebarWidgets();

        // --------------------------------------------------------------------------

        //  Meta
        $this->data['page']->title = $this->oBlog->label . ': ' . ucfirst($this->data['postNamePlural']) . ' tagged with "' . $this->data['tag']->label . '"';
        $this->data['page']->seo->description = 'All ' . $this->data['postNamePlural'] . ' tagged with  ' . $this->data['tag']->label . ' ';
        $this->data['page']->seo->keywords    = '';

        // --------------------------------------------------------------------------

        //  Handle pagination
        $page     = $this->uri->rsegment(5);
        $perPage = appSetting('home_per_page', 'blog-' . $this->oBlog->id);
        $perPage = $perPage ? $perPage : 10;

        $this->data['pagination']           = new stdClass();
        $this->data['pagination']->page     = $page;
        $this->data['pagination']->per_page = $perPage;

        // --------------------------------------------------------------------------

        //  Send any additional data
        $data                    = array();
        $data['include_body']    = !appSetting('use_excerpts', 'blog-' . $this->oBlog->id);
        $data['include_gallery'] = appSetting('home_show_gallery', 'blog-' . $this->oBlog->id);
        $data['sort']            = array('bp.published', 'desc');

        //  Only published items which are not schduled for the future
        $data['where']   = array();
        $data['where'][] = array('column' => 'bp.blog_id',   'value' => $this->oBlog->id);
        $data['where'][] = array('column' => 'is_published', 'value' => true);
        $data['where'][] = array('column' => 'published <=', 'value' => 'NOW()', 'escape' => false);

        // --------------------------------------------------------------------------

        //  Load posts and count
        $this->data['posts'] = $this->blog_post_model->getWithTag($this->data['tag']->id, $page, $perPage, $data);
        $this->data['pagination']->total = $this->blog_post_model->countAll($data);

        // --------------------------------------------------------------------------

        //  Any SEO data?
        if (!empty($this->data['tag']->seo_title)) {

            $this->data['page']->title = $this->data['tag']->seo_title;
        }

        if (!empty($this->data['tag']->seo_description)) {

            $this->data['page']->seo->description = $this->data['tag']->seo_description;
        }

        if (!empty($this->data['tag']->seo_keywords)) {

            $this->data['page']->seo->keywords = $this->data['tag']->seo_keywords;
        }

        // --------------------------------------------------------------------------

        //  Finally, let the views know this is an 'archive' type page
        $this->data['archive_title']       = ucfirst($this->data['postNamePlural']) . ' in tag "' . $this->data['tag']->label . '"';
        $this->data['archive_description'] = $this->data['tag']->description;
        $this->data['isTag']               = true;

        // --------------------------------------------------------------------------

        $oView = Factory::service('View');
        $oView->load('structure/header', $this->data);
        $this->loadView('browse', $this->data);
        $oView->load('structure/footer', $this->data);
    }
463295
public function getPostsByTagPaged(Blog $blog, Tag $tag, $filterByPublishPost, $page = 1)
    {
        $query = $this->repo->getByTag($blog, $tag, $filterByPublishPost, false);

        return $this->setPager($query, $page, $blog->getOptions()->getPostPerPage());
    }
230791
def get_type_by_url

      return 'P' if params[:slug].blank?

      # split the url up into segments
      segments = params[:slug].split('/')

      # general variables
      url = params[:slug]
      article_url = Setting.get('articles_slug')
      category_url = Setting.get('category_slug')
      tag_url = Setting.get('tag_slug')

      status = "(post_status = 'Published' AND post_date <= CURRENT_TIMESTAMP AND disabled = 'N')"

      # HACK: this needs to be optimised
      
      # is it a article post or a page post
      if segments[0] == article_url
        if !segments[1].blank?
          if segments[1] == category_url || segments[1] == tag_url
            # render a category or tag page
            return 'CT'
          elsif segments[1].match(/\A\+?\d+(?:\.\d+)?\Z/)
            # render the archive page
            return 'AR'
          else
            # otherwise render a single article page
            return 'A'
          end
        else
          # render the overall all the articles
          return 'C'
        end

      else
        # render a page
        return 'P'
      end

    end
225159
def query_tags(order=None, orderby=None, limit=None):
    
    from taggit.models import Tag, TaggedItem    # feature is still optional

    # Get queryset filters for published entries
    EntryModel = get_entry_model()
    ct = ContentType.objects.get_for_model(EntryModel)  # take advantage of local caching.

    entry_filter = {
        'status': EntryModel.PUBLISHED
    }
    if appsettings.FLUENT_BLOGS_FILTER_SITE_ID:
        entry_filter['parent_site'] = settings.SITE_ID

    entry_qs = EntryModel.objects.filter(**entry_filter).values_list('pk')

    # get tags
    queryset = Tag.objects.filter(
        taggit_taggeditem_items__content_type=ct,
        taggit_taggeditem_items__object_id__in=entry_qs
    ).annotate(
        count=Count('taggit_taggeditem_items')
    )

    # Ordering
    if orderby:
        queryset = queryset.order_by(*_get_order_by(order, orderby, TAG_ORDER_BY_FIELDS))
    else:
        queryset = queryset.order_by('-count')

    # Limit
    if limit:
        queryset = queryset[:limit]

    return queryset
19874
def filter_published(self, queryset):
        """"""
        if settings.PAGE_USE_SITE_ID:
            queryset = queryset.filter(sites=global_settings.SITE_ID)

        queryset = queryset.filter(status=self.model.PUBLISHED)

        if settings.PAGE_SHOW_START_DATE:
            queryset = queryset.filter(publication_date__lte=get_now())

        if settings.PAGE_SHOW_END_DATE:
            queryset = queryset.filter(
                Q(publication_end_date__gt=get_now()) |
                Q(publication_end_date__isnull=True)
            )

        return queryset
590377
def list_catalog(self, kind):
        '''
        
        '''
        kwd = {
            'pager': '',
            'title': '最近文档',
            'kind': kind,
            'router': config.router_post[kind]
        }
        self.render('admin/{0}/category_list.html'.format(self.tmpl_router),
                    kwd=kwd,
                    view=MCategory.query_all(kind, by_order=True),
                    format_date=tools.format_date,
                    userinfo=self.userinfo,
                    cfg=config.CMS_CFG)
847454
def drafts(self, blogname, **kwargs):
        
        url = "/v2/blog/{}/posts/draft".format(blogname)
        return self.send_api_request("get", url, kwargs, ['filter'])
1059143
def tagged(self, *tag_slugs):
        
        if getattr(self.model, 'tags', None) is None:
            raise AttributeError("The {0} does not include TagsEntryMixin".format(self.model.__name__))

        if len(tag_slugs) == 1:
            return self.filter(tags__slug=tag_slugs[0])
        else:
            return self.filter(tags__slug__in=tag_slugs).distinct()
307662
public function index()
    {
        /** @var \Colibri\Database\ModelCollection $items */
        $items = new $this->listClass();
        $this->applyListFilters($items);
        $items->load();

        $this->template->vars[$this->listTplVar] = $items;
        if ($this->pagedList) {
            $this->template->vars['pagination'] = [
                'page'           => (int)(isset($_GET['page']) ? $_GET['page'] : 0),
                'recordsPerPage' => $items->recordsPerPage,
                'recordsCount'   => $items->recordsCount,
                'pagesCount'     => $items->pagesCount,
                'base_url'       => '/' . $this->division . '/' . $this->module,
            ];
        }
    }
1213139
def blog__get_categories(
      order: nil,
      language: nil,
      search: nil,
      page: nil,
      per_page: nil
    )
      categories = LatoBlog::Category.all

      # apply filters
      order = order && order == 'ASC' ? 'ASC' : 'DESC'
      categories = _categories_filter_by_order(categories, order)
      categories = _categories_filter_by_language(categories, language)
      categories = _categories_filter_search(categories, search)

      # take categories uniqueness
      categories = categories.uniq(&:id)

      # save total categories
      total = categories.length

      # manage pagination
      page = page&.to_i || 1
      per_page = per_page&.to_i || 20
      categories = core__paginate_array(categories, per_page, page)

      # return result
      {
        categories: categories && !categories.empty? ? categories.map(&:serialize) : [],
        page: page,
        per_page: per_page,
        order: order,
        total: total
      }
    end
1130162
public function index()
    {
        if (!userHasPermission('admin:blog:settings:\d+:update')) {

            unauthorised();
        }

        // --------------------------------------------------------------------------

        //  Load models
        $this->load->model('blog/blog_model');
        $oSkinModel = Factory::model('Skin', 'nails/module-blog');

        // --------------------------------------------------------------------------

        $this->data['blogs'] = $this->blog_model->getAllFlat();

        if (empty($this->data['blogs'])) {

            if (userHasPermission('admin:blog:blog:create')) {

                $status   = 'message';
                $message  = '<strong>You don\'t have a blog!</strong> Create a new blog ';
                $message .= 'in order to configure blog settings.';
                $oSession = Factory::service('Session', 'nails/module-auth');
                $oSession->setFlashData($status, $message);
                redirect('admin/blog/blog/create');

            } else {

                show404();
            }
        }

        if (count($this->data['blogs']) == 1) {

            reset($this->data['blogs']);
            $this->data['selectedBlogId'] = key($this->data['blogs']);

        } elseif ($this->input->get('blog_id')) {

            if (!empty($this->data['blogs'][$this->input->get('blog_id')])) {

                $this->data['selectedBlogId'] = $this->input->get('blog_id');
            }

            if (empty($this->data['selectedBlogId'])) {

                $this->data['error'] = 'There is no blog by that ID.';
            }
        }

        //  Check user has permission
        if (!empty($this->data['selectedBlogId'])) {

            if (!userHasPermission('admin:blog:settings:' . $this->data['selectedBlogId'] . ':update')) {

                unauthorised();
            }
        }

        //  Set up the skin model for this blog
        //  @todo; work out a cleaner way of handling this
        $oSkinModel->init($this->data['selectedBlogId']);

        // --------------------------------------------------------------------------

        //  Process POST
        if ($this->input->post()) {

            //  Prepare update
            $settings                       = array();
            $settings['name']               = $this->input->post('name');
            $settings['url']                = $this->input->post('url');
            $settings['postName']           = strtolower($this->input->post('postName'));
            $settings['postNamePlural']     = strtolower($this->input->post('postNamePlural'));
            $settings['use_excerpts']       = (bool) $this->input->post('use_excerpts');
            $settings['gallery_enabled']    = (bool) $this->input->post('gallery_enabled');
            $settings['categories_enabled'] = (bool) $this->input->post('categories_enabled');
            $settings['tags_enabled']       = (bool) $this->input->post('tags_enabled');
            $settings['rss_enabled']        = (bool) $this->input->post('rss_enabled');

            //  Skin settings
            $settings['skin'] = $this->input->post('skin');

            //  Commenting settings
            $settings['comments_enabled']          = $this->input->post('comments_enabled');
            $settings['comments_engine']           = $this->input->post('comments_engine');
            $settings['comments_disqus_shortname'] = $this->input->post('comments_disqus_shortname');

            //  Social settings
            $settings['social_facebook_enabled']   = (bool) $this->input->post('social_facebook_enabled');
            $settings['social_twitter_enabled']    = (bool) $this->input->post('social_twitter_enabled');
            $settings['social_twitter_via']        = $this->input->post('social_twitter_via');
            $settings['social_googleplus_enabled'] = (bool) $this->input->post('social_googleplus_enabled');
            $settings['social_pinterest_enabled']  = (bool) $this->input->post('social_pinterest_enabled');
            $settings['social_skin']               = $this->input->post('social_skin');
            $settings['social_layout']             = $this->input->post('social_layout');
            $settings['social_layout_single_text'] = $this->input->post('social_layout_single_text');
            $settings['social_counters']           = (bool) $this->input->post('social_counters');

            //  If any of the above are enabled, then social is enabled.
            $settings['social_enabled'] = $settings['social_facebook_enabled'] || $settings['social_twitter_enabled'] || $settings['social_googleplus_enabled'] || $settings['social_pinterest_enabled'];

            //  Sidebar
            $settings['sidebar_latest_posts']  = (bool) $this->input->post('sidebar_latest_posts');
            $settings['sidebar_categories']    = (bool) $this->input->post('sidebar_categories');
            $settings['sidebar_tags']          = (bool) $this->input->post('sidebar_tags');
            $settings['sidebar_popular_posts'] = (bool) $this->input->post('sidebar_popular_posts');

            //  @todo: Associations

            // --------------------------------------------------------------------------

            //  Sanitize blog url
            $settings['url'] .= substr($settings['url'], -1) != '/' ? '/' : '';

            // --------------------------------------------------------------------------

            //  Save
            $oAppSettingService = Factory::service('AppSetting');

            if ($oAppSettingService->set($settings, 'blog-' . $this->input->get('blog_id'))) {

                $this->data['success'] = 'Blog settings have been saved.';

                $oRoutesService = Factory::service('Routes');

                if (!$oRoutesService->update()) {

                    $this->data['warning']  = '<strong>Warning:</strong> while the blog settings were updated, the ';
                    $this->data['warning'] .= 'routes file could not be updated. The blog may not behave as expected,';
                }

            } else {

                $this->data['error'] = 'There was a problem saving settings.';
            }
        }

        // --------------------------------------------------------------------------

        //  Get data
        $this->data['skins']        = $oSkinModel->getAll();
        $this->data['skinSelected'] = $oSkinModel->getEnabled();

        if (!empty($this->data['selectedBlogId'])) {

            $this->data['settings'] = appSetting(null, 'blog-' . $this->data['selectedBlogId'], true);
        }

        // --------------------------------------------------------------------------

        //  Load assets
        $oAsset = Factory::service('Asset');
        $oAsset->load('admin.settings.min.js', 'nails/module-blog');

        // --------------------------------------------------------------------------

        //  Set page title
        $this->data['page']->title = 'Settings &rsaquo; Blog';

        if (!empty($this->data['blogs'][$this->input->get('blog_id')])) {

            $this->data['page']->title .= ' &rsaquo; ' . $this->data['blogs'][$this->input->get('blog_id')];
        }

        // --------------------------------------------------------------------------

        //  Add a header button
        if (userHasPermission('admin:blog:blog:manage')) {
            Helper::addHeaderButton(
                'admin/blog/blog/index',
                'Manage Blogs'
            );
        }

        // --------------------------------------------------------------------------

        Helper::loadView('index');
    }
400230
public function FilterDescription()
    {
        $params = $this->parseParams();

        $filters = array();
        if ($params['tag']) {
            $term = TaxonomyTerm::get_by_id(TaxonomyTerm::class, $params['tag']);
            if ($term) {
                $filters[] = _t(
                    'CWP\\CWP\\PageTypes\\DatedUpdateHolder.FILTER_WITHIN',
                    'within'
                ) . ' "' . $term->Name . '"';
            }
        }

        if ($params['from'] || $params['to']) {
            if ($params['from']) {
                $from = strtotime($params['from']);
                if ($params['to']) {
                    $to = strtotime($params['to']);
                    $filters[] = _t('CWP\\CWP\\PageTypes\\DatedUpdateHolder.FILTER_BETWEEN', 'between') . ' '
                        . date('j/m/Y', $from) . ' and ' . date('j/m/Y', $to);
                } else {
                    $filters[] = _t('CWP\\CWP\\PageTypes\\DatedUpdateHolder.FILTER_ON', 'on')
                        . ' ' . date('j/m/Y', $from);
                }
            } else {
                $to = strtotime($params['to']);
                $filters[] = _t('CWP\\CWP\\PageTypes\\DatedUpdateHolder.FILTER_ON', 'on')
                    . ' ' . date('j/m/Y', $to);
            }
        }

        if ($params['year'] && $params['month']) {
            $timestamp = mktime(1, 1, 1, $params['month'], 1, $params['year']);
            $filters[] = _t('CWP\\CWP\\PageTypes\\DatedUpdateHolder.FILTER_IN', 'in')
                . ' ' . date('F', $timestamp) . ' ' . $params['year'];
        }

        if ($filters) {
            return $this->getUpdateName() . ' ' . implode(' ', $filters);
        }
    }