Why my modifications have no effects on Symfony website? - symfony

I'm in charge of the administration of website build on Symfony but i'm not very familiar with this framework.
They want me to delete the Deutsch part. My first move was to delete the Deutsch link in the languages dropdown menu.
But even if in the source code the link is now gone, it keeps displaying on the website what am I missing ?
{% trans %}Language{% endtrans %}
<ul class="dropdown-menu pull-right">
<li>English</li>
<li>Français</li>
<li>Italiano</li>
<li>Español</li>
</ul>
Here's the website: http://valessentia.com/fr

Related

Custom menu in Sonata (Symfony) without creating a new entity

I'm new to stackoverflow (it's my first post), and new to Symfony2 and SonataAdmin (a bundle) too, and I have a little problem (I searched, but I cant find a working solution..).
I've created a few entities and they all appear on the left of the dashboard, in the menu, and this is working fine.
But what I want to do is add tabs without creating entity, and when you click on this menu tab, only the content of the right to be changed ! Is that possible? Thank you
Create an empty template in the Resources/views directory of your own admin bundle
(e.g. custom_layout.html.twig).
Then, in your app/config open config.yml (or sonata/admin.yml if you have separated config files for sonata) and add (or update if exists) the following :
sonata_admin:
# ...
templates:
layout: YourBundle::custom_layout.html.twig
Last, open the empty template, make it extending from the standard_layout.html.twig,
override the good block,
and add your custom menu (copy the markup of an existing) :
{% extends 'SonataAdminBundle::standard_layout.html.twig' %}
{% block side_bar_after_nav %}
<li class="treeview">
<a href="#">
<i class="fa fa-folder"></i>
<span>Custom Menu</span>
<i class="fa pull-right fa-angle-left"></i>
</a>
<ul class="treeview-menu">
<li class="first last">
<a href="{{ path('custom_route') }}">
<i class="fa fa-angle-double-right"></i>
Custom link
</a>
</li>
</ul>
</li>
{% endblock %}
That's all.

What would be the best way to create my menu in Symfony 2

I'm working on the admin of my portfolio and I'm having a dilemma about my menu. The admin side of my portfolio allows me to change some general info, add, modify or delete a project. Therefore, all pages of my admin have the same menu. The menu have the following buttons: a button to change the general info and a button to add a new project. if there are projects in the database, the menu have more things, a select with the names of my projects and the two buttons to modify or delete the project.
At first, I made a form for everything about the project and an other just for the change info button, but after asking some question, I got often told that I shoudn't make any form for that and that just making link should be fine.
I like that idea, but, if I do that, how can I pass the selected project when I click on modify for exemple?
<a href="{{ path("modify_project") }}">
Here is my current code:
<ul>
<li>
Ajouter un projet
</li>
</ul>
{% if projets | length > 0%}
<select>
{% for id,projet in projets %}
<option value={{ id }}>{{ projet }}</option>
{% endfor %}
</select>
<ul>
<li>
Modifier
</li>
<li>
Supprimer
</li>
</ul>
{% endif %}
If someone have a better idea, I will be very interested to ear it.
Have you had a look at this: https://github.com/KnpLabs/KnpMenuBundle?
Sorry, your are right, the answer is actually this one:
{{ entity.id }}
Twig will understand that, nothing more to do.
After really thinking about it, The best way would be a form, since you can't change the href of the link, except with javascript and I don't want to do that.

Double content with events manager and Qtranslate on Wordpress

I'm making a Wordpress site with the Events manager plugin and Qtranslate.
When I display the event page the content will show in the correct language.
But when I use the event/location list or upcoming events widget from the eventsmanager plugin,
It shows the content in both languages.
This is my code in the location list:
<li class="event-page-list-item">
<ul>
<li class="event-list-title item">#_LOCATIONNAME</li>
<li class="event-list-location item">#_LOCATIONADDRESS</li>
<li class="event-list-location item">#_LATT{email adres}{E-mail niet bekend}</li>
<li class="event-list-location item">#_LATT{website}{Website niet bekend}</li>
</ul>
</li>

Custom topbar in Elgg

I've tried to google and read everywhere including here but no comprehensive tutorial can be found about this.
I want to totally change my topbar to something like this
<ul class="nav navbar-nav navbar-right">
<li>
Friends
</li>
<li>
Inbox
</li>
<li>
Dashboard
</li>
<li>
Settings
</li>
<li>
Logout
</li>
<li>
Announcements
</li>
</ul>
I can basically 'hard-code' this in topbar.php but i'm afraid I may not get the links right. Any best practices suggestions out there for this noob?
Elgg is designed to be plugin-centric, so by default it's expected that a lot of plugins may want to tap to main menu. There are three paths to follow:
Use tool in admin panel: Configure -> Appearance -> Menu Items
Unregister unnecessary menu items with elgg_unregister_menu_item and than rearrange them through plugin hook.
Downside of that is that adding new plugins may add unexpected menu items, but pro is that you may easily redistribute your code without worrying about synchronizing settings set via admin panel.
If you want to take control over whole menu rendering process, you'll want to override view navigation/menu/site and use any markup you desire. Links should be absolute. Use elgg_get_site_url() as the base.

Print second level menu in Drupal 8

Drupal 8 markup changed quite a lot from Drupal 7 using the Twig Engine. We are developing a site with it. We want to print the second level menu links in there.
{% if main_menu %}
<nav id ="main-menu" class="navigation" role="navigation">
{{ main_menu }}
</nav> <!-- /#main-menu -->
This is how we print the menu in Drupal 8. A syntax im not quite used to.
How can i print. Second level links on the menu. Or the Menu Tree?
According to template_preprocess_page(), you should have access to secondary_menu as well, so:
{% if secondary_menu %}
<nav id ="secondary-menu" class="navigation" role="navigation">
{{ secondary_menu }}
</nav>
{% endif %}
Generally speaking, you can use a preprocess hook to add variables. In this case that would be something like:
function MYTHEME_preprocess_page(&$vars) {
$vars['foo'] = 'bar'; // foo is available in the page template file
}
Depending on which theme you use, it may be that it is not a problem with the menu template. In my case, the (main) menu was configured to show only one level in the block settings.
I found out by chance, here is how to change it:
Go to https://<yourdrupalpage>/admin/structure/block
on the respective menu block item (e.g. main menu) click configure
adjust the number of visible menu levels to your needs
that should to the trick
I did what Stephan Richter suggest but I forgot to check "Always display open" equivalent option in the menu item level1
So If you want your level 2 to be displayed, do not forget this option in the parent.

Resources