Render the collection page.

    It renders it either with a collection specific template (aka
    collection_{collection_name}.html) or with the default collection
    template (collection.html).
16512
def collection(name=None):
    
    if name is None:
        collection = Collection.query.get_or_404(1)
    else:
        collection = Collection.query.filter(
            Collection.name == name).first_or_404()

    # TODO add breadcrumbs
    # breadcrumbs = current_breadcrumbs + collection.breadcrumbs(ln=g.ln)[1:]
    return render_template([
        'invenio_collections/collection_{0}.html'.format(collection.id),
        'invenio_collections/collection_{0}.html'.format(slugify(name, '_')),
        current_app.config['COLLECTIONS_DEFAULT_TEMPLATE']
    ], collection=collection)
640640
public function render() {

		$title = $list = $template = '';

		if ( $this->items ) {

			// If there's title text, format it.
			if ( $this->args['title_text'] ) {

				$title = sprintf(
					'<%1$s class="%2$s">%3$s</%1$s>',
					tag_escape( $this->args['title_tag'] ),
					esc_attr( $this->args['title_class'] ),
					esc_html( $this->args['title_text'] )
				);
			}

			// Loop through each of the items and format each into
			// an HTML string.
			foreach ( $this->items as $item ) {

				$list .= $this->formatItem( $item );
			}

			// Format the list.
			$list = sprintf(
				'<%1$s class="%2$s">%3$s</%1$s>',
				tag_escape( $this->args['list_tag'] ),
				esc_attr( $this->args['list_class'] ),
				$list
			);

			// Format the nav wrapper.
			$template = sprintf(
				'<%1$s class="%2$s" role="navigation">%3$s%4$s</%1$s>',
				tag_escape( $this->args['container_tag'] ),
				esc_attr( sprintf( $this->args['container_class'], $this->context ) ),
				$title,
				$list
			);
		}

		return apply_filters( "hybrid/pagination/{$this->context}", $template, $this->args );
	}
452196
function Views(options) {
  Collection.call(this, options);
  this.options.collection = this.options.collection || this;
  this.define('View', this.options.View || require('./view'));
  this.define('Item', this.View);
}
280918
function Render()
    {
        self::$currentPage = $this->page;
        self::$Title = self::$currentPage->GetTitle();
        self::$Description = self::$currentPage->GetDescription();
        self::$Keywords = self::$currentPage->GetKeywords();
        if ($this->page->GetType() == (string)PageType::NotFound())
        {
            header('HTTP/1.0 404 Not Found');
        }
        else if ($this->page->GetType() !== (string)PageType::Normal())
        {
            throw new \Exception('Internal phine error: not normal page called');
        }
        ob_start();
        require PathUtil::LayoutTemplate($this->layout);
        $result = ob_get_clean();
        $replacer = new Replacer();
        return $replacer->RealizeVariables($result);
    }
263407
def render(self, template, context=None, def_name=None, subdir='templates', content_type=None, status=None, charset=None):
        ''''''
        template_adapter = self.get_template_loader(subdir).get_template(template)
        return getattr(template_adapter, 'render_to_response')(context=context, request=self.request, def_name=def_name, content_type=content_type, status=status, charset=charset)
1254343
def render context=nil, template_or_src=nil, &block
      compiled_template = compile(template_or_src, &block)
      context.instance_eval compiled_template
    end
1247666
public function showPages()
    {
        // Get dependencies
        $page = ($this->container->dataMapper)('PageMapper');

        // Fetch pages & templates
        $data['pages'] = $page->findPages(true);
        $data['templates'] = $this->getPageTemplates('page');

        return $this->render('pages.html', $data);
    }
860055
private static function _addCustomAttributes(Collection $collection)
    {
        if (self::$_customPaginationPresenter) {
            $collection->setPaginationPresenter(self::$_customPaginationPresenter);
        }
        if (self::$_customView) {
            $collection->view(self::$_customView);
        }
        if (self::$_customCustomView) {
            $collection->customView(self::$_customCustomView);
        }
        if (self::$_customPaginate) {
            $collection->paginate(self::$_customPaginate);
        }
        if (self::$_customPerPage) {
            $collection->perPage(self::$_customPerPage);
        }
        if (self::$_customPage) {
            $collection->page(self::$_customPage);
        }
        if (self::$_customFilter) {
            $collection->filter(self::$_customFilter);
        }
        if (self::$_rendererNamespace) {
            $collection->setRendererNamespace(self::$_rendererNamespace);
        }

        return $collection;
    }
1161625
function renderPage(page) {
    var template = pageTemplate(page);
    var html = renderTemplate(page, template);
    return '<div data-render-page="' + esc(template) + '">' + html + '</div>';
  }
600794
def render(self):
        """"""
        context = GLOBAL_TEMPLATE_CONTEXT.copy()
        context['tag'] = self
        entries = list(self.entries)
        entries.sort(key=operator.attrgetter('date'), reverse=True)
        context['entries'] = entries

        # render html page
        render_to = os.path.join(CONFIG['output_to'], 'tags', self.slug)
        if not os.path.exists(render_to):  # pragma: no coverage
            os.makedirs(render_to)
        _render(context, 'tag_index.html', os.path.join(render_to, 'index.html'))  # noqa

        # render atom.xml
        context['entries'] = context['entries'][:10]
        context['last_build'] = datetime.datetime.now().strftime("%Y-%m-%dT%H:%M:%SZ")  # noqa

        _render(context, 'atom.xml', os.path.join(render_to, 'atom.xml'))
        return True
480916
def render(template, *arguments)
      #
      # find the right renderer we need
      #
      block, handler = find_template(template)

      raise TemplateNotFound if block.nil?

      ctx = handler.new(self)
      ctx.params = @params
      ctx.request = @request

      ctx.instance_exec(*arguments, &block)
    end
461657
public function renderTemplate(Collection $collection)
    {
        $escapeHtmlAttribHelper = $this->getEscapeHtmlAttrHelper();
        $fieldSetHelper = $this->getFieldsetHelper();

        $templateMarkup = '';

        $elementOrFieldSet = $collection->getTemplateElement();

        if ($elementOrFieldSet instanceof AbstractLineFieldSet) {
            $templateMarkup .= sprintf(
                $this->rowWrap,
                $this->getLineType(),
                $fieldSetHelper($elementOrFieldSet, $this->shouldWrap()),
                ucfirst($this->getLineType())
            );
        }

        return sprintf(
            $this->getTemplateWrapper(),
            $this->getLineType(),
            $escapeHtmlAttribHelper($templateMarkup)
        );
    }
1321616
public function render(Route $route, $name = null)
    {
        if (null !== $name && true === $this->generatorCollection->has($name)) {
            $parameters = $this->generatorCollection->get($name)->generate();
        } else {
            $parameters = [ [] ];
        }

        foreach ($parameters as $parameter) {
            $this->renderWithParameters($route, $name, $parameter);
        }
    }
920494
protected function addPageName()
    {
        if (! empty($this->getPageName()) && ! in_array($this->getPageName(), $this->collection)) {
            $this->add($this->getPageName());
        }
    }
1343758
public function render() : void
    {
        $langRoot = $this->categoryRepository->findLangRoot($this->activeLang);

        $categories = [];

        if ($langRoot && $langRoot->getDescendants() instanceof ObjectCollection)
        {
            $root = $this->categoryRepository->findDescendants($langRoot);
            $left = (count($root) > 0) ? $root[0]->getLeftValue() - 1 : 0;
            $categories = $this->nested->getTree($root, $left);
        }

        $this->template->categories = $categories;
        $this->template->setFile(__DIR__ . '/templates/modal.latte');
        $this->template->render();
    }
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,
            ];
        }
    }
965742
def render(self, name, value, attrs=None, renderer=None):
        
        context = self.get_context(name, value, attrs)
        return self._render(self.template_name, context, renderer)