Skip to content

Commit

Permalink
[GeneratorBundle]: set correct path for article detail
Browse files Browse the repository at this point in the history
Add HideSidebarInNodeEditInterface to generator articles, add select2 dropdown

Don't override locale, just use it in trans
  • Loading branch information
sandergo90 committed Mar 6, 2018
1 parent a6e7c2d commit d871f50
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
5 changes: 2 additions & 3 deletions src/Kunstmaan/ArticleBundle/Router/TagCategoryRouter.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@ public function getRouteCollection()

if ($this->isMultiLanguage()) {
foreach ($this->getFrontendLocales() as $locale) {
$translator->setLocale($locale);
$categoryTrans = $translator->trans('article_overview_page.route.category');
$tagTrans = $translator->trans('article_overview_page.route.tag');
$categoryTrans = $translator->trans('article_overview_page.route.category', [], null, $locale);
$tagTrans = $translator->trans('article_overview_page.route.tag', [], null, $locale);

$routePathParts = array(
'_slug_category_tag' => sprintf('/%s/{category}/%s/{tag}', $categoryTrans, $tagTrans),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Kunstmaan\ArticleBundle\Entity\AbstractArticlePage;
use Kunstmaan\NodeSearchBundle\Helper\SearchTypeInterface;
use Kunstmaan\PagePartBundle\Helper\HasPageTemplateInterface;
use Kunstmaan\NodeBundle\Entity\HideSidebarInNodeEditInterface;
use {{ namespace }}\Form\Pages\{{ entity_class }}PageAdminType;
use Symfony\Component\Form\AbstractType;

Expand All @@ -15,7 +16,7 @@
* @ORM\Table(name="{{ prefix }}{{ entity_class|lower }}_pages")
* @ORM\HasLifecycleCallbacks
*/
class {{ entity_class }}Page extends AbstractArticlePage implements HasPageTemplateInterface, SearchTypeInterface
class {{ entity_class }}Page extends AbstractArticlePage implements HasPageTemplateInterface, SearchTypeInterface, HideSidebarInNodeEditInterface
{
//%PagePartial.php.twig%

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
'multiple' => true,
'expanded' => false,
'attr' => array(
'class' => 'js-advanced-select',
'data-placeholder' => 'Choose the related {{ pluralType }}'
),
'required' => false
));
{% endif %}
{% endif %}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<% endif %>
</time>
<h3 class="blog-item__head__title">
<a href="{{ articlenode.url }}">
<a href="{{ path('_slug', {'url': articlenode.url}) }}">
{{ article.title }}
</a>
</h3>
Expand All @@ -52,7 +52,7 @@
{{ article.summary }}

<p class="text--right blog-item__read-more">
<a href="{{ articlenode.url }}" class="blog-item__read-more__link">
<a href="{{ path('_slug', {'url': articlenode.url}) }}" class="blog-item__read-more__link">
{{ 'article.readmore'|trans }}
</a>
</p>
Expand Down

0 comments on commit d871f50

Please sign in to comment.