Main toujours visible.

Replied by Apoulit on topic Main toujours visible.

Posted 8 years 11 months ago #27762
Et si je veut le faire à d'autres pages contact etc ...quel est le code ?
Code:
<?php // Detecting Home $menu = JFactory::getApplication()->getMenu(); if ($menu->getActive() == $menu->getDefault()) { $accueil = 1; $contact = 1; }else{ $accueil = 0; $contact = 0; } ?>
Code:
<?php if(! $accueil) { ?> <?php if(! $contact) { ?>
Last Edit:8 years 11 months ago by Apoulit
Last edit: 8 years 11 months ago by Apoulit .

Please Log in or Create an account to join the conversation.

Replied by ced1870 on topic Main toujours visible.

Posted 8 years 11 months ago #27763

Qu-est ce que je ferai sans toi ;)

je ne sais pas mais tu ne serais pas sur mon forum :D

Et si je veut le faire à d'autres pages contact etc ...quel est le code ?

tu peux utiliser les variables que tu veux, comme celles qui sont déjà dans le index.php :
Code:
$app = JFactory::getApplication(); // Detecting Active Variables $option = $app->input->getCmd('option', ''); $view = $app->input->getCmd('view', ''); $layout = $app->input->getCmd('layout', ''); $task = $app->input->getCmd('task', ''); $itemid = $app->input->getCmd('Itemid', ''); $sitename = $app->get('sitename');

Joomlack Webmaster and Developer

by ced1870

Please Log in or Create an account to join the conversation.

Replied by Apoulit on topic Main toujours visible.

Posted 8 years 11 months ago #27764
Le php c'est pas ma tasse de thé :
si je veux le cacher dans accueil , contact , newsletter je peux pas dupliquer le code en adaptant ?
Code:
<?php // Detecting Home $menu = JFactory::getApplication()->getMenu(); if ($menu->getActive() == $menu->getDefault()) { $accueil = 1; }else{ $accueil = 0; } ?> <?php // Detecting contact $menu = JFactory::getApplication()->getMenu(); if ($menu->getActive() == $menu->getDefault()) { $contact = 1; }else{ $contact = 0; } ?>

Please Log in or Create an account to join the conversation.

Replied by ced1870 on topic Main toujours visible.

Posted 8 years 11 months ago #27766

// Detecting contact

tu ne détectes rien, la condition est celle de la page accueil ...

avec

$option = $app->input->getCmd('option', '');

tu peux imaginer

if ($option == 'com_contact') {
$contact = 1;
}else{
$contact = 0;
}

Joomlack Webmaster and Developer

by ced1870

Please Log in or Create an account to join the conversation.

Time to create page: 0.629 seconds

Fast and powerful creation, customizable and responsive.

Read More

We have 673 guests and no members online