Page 2 of 3

Re: page&post in index

Posted: Tue Jul 05, 2016 1:13 am
by diego

Re: page&post in index

Posted: Tue Jul 05, 2016 6:09 am
by viriisxp
hi , that will be :

- Découvrez le Rotary -> page
- Actualités du club -> post
- Nos actions -> page
- L'Équipe -> page


and write now it is :
http://www.rotaryclub-balma.fr/notre-histoire

forget monclub.fr ;)

Re: page&post in index

Posted: Tue Jul 05, 2016 5:09 pm
by viriisxp
i've find a switch but i don't think that the best option :

<?php

$url = 'http://www.rotaryclub-balma.fr/api/show ... cf735df844';
$jsonData = file_get_contents($url);
$data = json_decode($jsonData, true);

foreach($data as $page) {
if ($page['key']=='notrehistoire'){
$pagePermalink = $page['permalink'];

echo '<h3>'.$page['title'].'</h3>';
echo $page['content'];


echo '<br>';
}
}

?>

that's work like i need. did you have any other option ?

Re: page&post in index

Posted: Tue Jul 05, 2016 6:23 pm
by Edi
1) Have you tried something with the page "Notre Histoire" as Default home page (Paramètres > Avancé > Général > Page d'accueil par défaut)?

2) You can also use the following:

Code: Select all

foreach ($pages as $Page){
   if ($Page->title()=='Notre Histoire'){
      echo $Page->content();
   }
}
By the way: Very nice website!

Re: page&post in index

Posted: Tue Jul 05, 2016 6:28 pm
by viriisxp
hi,

1/ no, i don't because i will make a 2 & 3 pages for "nos actions" & "les membres" so, i think that will make an error, doesn't it ?

2/ yes, but, if i change the title or if the owner (my client) want to change the title ;)

3/ thx, i appreciated ;) , i take time but i finish to have the result i want ... ;), and i discovered this cms and i like the possibility. just need now to learn exactly how it work ;)

Re: page&post in index

Posted: Tue Jul 05, 2016 6:45 pm
by Edi
1) This sets only a page as mainpage. There can be beside this other pages.

2) Also $page['key'] has to be changed if the title will be changed.

Re: page&post in index

Posted: Tue Jul 05, 2016 6:47 pm
by viriisxp
the $key is not the url friendly ?

Re: page&post in index

Posted: Tue Jul 05, 2016 7:02 pm
by Edi
Yes, it is. But you have it to rewrite it (Avancé > Réécriture d'URL). Otherwise the modified title is used.

Re: page&post in index

Posted: Tue Jul 05, 2016 8:38 pm
by viriisxp
hum, ok, i will see if it's possible to make a plugin to lock this option. ;)

Re: page&post in index

Posted: Wed Jul 06, 2016 2:20 am
by diego
My bad! it's a bug:

Could you change on this file: /bl-plugins/api/plugin.php

Line 160:

Code: Select all

for($i=0; $i<4; $i++) {
For this

Code: Select all

for($i=0; $i<3; $i++) {