Answer the question
In order to leave comments, you need to log in
How to switch between displaying content of grid type and list type?
there are some search results that
need to be displayed in the form of a list and in the form of a grid (let's say 3 cells in one line
)
<div class="list-item">..</div>
<div class="grid-item">..</div>
<div class="list-item">..</div>
<div class="grid-item">..</div>
...
Answer the question
In order to leave comments, you need to log in
tympanus.net/Blueprints/ViewModeSwitch if this is it, then above is a link to the article.
wrap the output in a block and, depending on the selected output type, add the results--grid or results--item modifier class to it and, as you wrote, hide unnecessary elements in the styles:
.results--grid .list-item {
display:none;
}
.results--list .grid-item {
display:none;
}
devacademy.ru/posts/symfony-2-joboard-rss
you can take logic from here, in particular, you can use magic
public function indexAction()
{
$format = $this->getRequest()->getRequestFormat();
return $this->render('AcmeBlogBundle:Blog:index.'.$format.'.twig');
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question