page&post in index

User avatar
diego
Site Admin
Posts: 773
Joined: Sat May 16, 2015 2:53 pm
Been thanked: 1 time
Contact:

viriisxp
Sr. Bludit
Posts: 33
Joined: Sat Jul 02, 2016 6:01 pm

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 ;)
viriisxp
Sr. Bludit
Posts: 33
Joined: Sat Jul 02, 2016 6:01 pm

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 ?
User avatar
Edi
Site Admin
Posts: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

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!
viriisxp
Sr. Bludit
Posts: 33
Joined: Sat Jul 02, 2016 6:01 pm

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 ;)
User avatar
Edi
Site Admin
Posts: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

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.
viriisxp
Sr. Bludit
Posts: 33
Joined: Sat Jul 02, 2016 6:01 pm

the $key is not the url friendly ?
User avatar
Edi
Site Admin
Posts: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

Yes, it is. But you have it to rewrite it (Avancé > Réécriture d'URL). Otherwise the modified title is used.
viriisxp
Sr. Bludit
Posts: 33
Joined: Sat Jul 02, 2016 6:01 pm

hum, ok, i will see if it's possible to make a plugin to lock this option. ;)
User avatar
diego
Site Admin
Posts: 773
Joined: Sat May 16, 2015 2:53 pm
Been thanked: 1 time
Contact:

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++) {
Post Reply