Symfony path not open link but work in new tab

In my project Symfony I’m listing categories, everything works fine visually and the links appear correctly.

But un my project when I left click the website did nothing and when I select open in a new tab my link works and appear correctly.

The error is coming from this part of my code :

<div class="nav-content">
        <ul class="tabs tabs-transparent">
            {% for categorie in  categories.categories %}
                <li class="tab"><a target="_blank" class="black-text" href="{{ path('client.constructeurs.view', {CategorieParentId: categorie.id }) }}">{{ categorie.categorieIntitule }}</a></li>
             {% endfor %}
        </ul>
    </div>

On the Mobile demo it works correctly :

{% for categorie in  categories.categories %}
        <li class="tab black-text"><a class="black-text" href="{{path('client.constructeurs.view', {CategorieParentId: categorie.id }) }}">{{ categorie.categorieIntitule }}</a></li>
    {% endfor %}

Any idea ?

Here is my code :

<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css" rel="stylesheet"/>
<nav class="nav-extended white ">
    <div class="nav-wrapper ">
        <a href="#" class="brand-logo"><img src="https://via.placeholder.com/100x60.png" alt="Logo Spie"></a>
        <a href="#" data-target="mobile-demo" class="sidenav-trigger"><i class="black-text material-icons">menu</i></a>
        <ul id="nav-mobile" class="right hide-on-med-and-down black-text">
            <li>
                <div class="center row ">
                    <div class="col s12 " >
                        <div class="row" id="topbarsearch">
                            <div class="input-field col s6 s12 black-text">
                                <i class="black-text material-icons prefix">search</i>
                                <input type="text" placeholder="search" id="autocomplete-input" class="autocomplete black-text" >
                            </div>
                        </div>
                    </div>
                </div>
            </li>

            <li class="black-text"><a class="black-text" href="sass.html"> SASS</a></li>
            <li><a class="black-text" href="badges.html">Components</a></li>
            <li><a class="black-text" href="#">Mon Compte</a></li>
        </ul>
    </div>
    <div class="nav-content">
        <ul class="tabs tabs-transparent">
            {% for categorie in  categories.categories %}
                <li class="tab"><a class="black-text" href="{{ path('client.constructeurs.view', {CategorieParentId: categorie.id }) }}">{{ categorie.categorieIntitule }}</a></li>
             {% endfor %}
        </ul>
    </div>
</nav>

<ul class="sidenav" id="mobile-demo">
    {% for categorie in  categories.categories %}
        <li class="tab black-text"><a class="black-text" href="{{path('client.constructeurs.view', {CategorieParentId: categorie.id }) }}">{{ categorie.categorieIntitule }}</a></li>
    {% endfor %}
    <li><a href="sass.html">Sass</a></li>
    <li><a href="badges.html">Components</a></li>
    <li><a href="#">Mon Compte</a></li>
</ul>

Source: Symfony Questions

Was this helpful?

0 / 0

Leave a Reply 0

Your email address will not be published. Required fields are marked *