Api for V2

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

hi, i would like to update my old version of bludit but in the last version i do something like this for the api :

Code: Select all

<?php
    $url = 'https://www.mywebsite.fr/api/show/all/pages/b547d5bed80a3435ba9fac89bcb34ba6';
    $result = file_get_contents($url);
        $data = json_decode($result, true);
        foreach($data as $page) {
            if (strstr($page['key'],'v2-')){ 
                echo "<section>";
                echo $page['content'];
                echo "</section>";
            }
        }
?>

with this, i can see all my pages in onepage website . But now with the new api, i can't found how i can't do this. Why did you delete the information on the api plugins ...


please, can you help me ?

Of course i check the https://docs.bludit.com/en/api/introduc ... stallation but i can't select the content from my page. that's what he say ;) .

i have a second request in the same time ( api too),

i try to see the page only if the title of page called : "bienvenue". and i would like to see the content only from this page.

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

Hi,
have you check this one: https://docs.bludit.com/en/api/read-content
viriisxp
Sr. Bludit
Posts: 33
Joined: Sat Jul 02, 2016 6:01 pm

yes, i check it.

i found some of my solution.

Second question, with this api is it possible to grab content by JS ?

an other question : i try to do something like this :

Code: Select all

																			$categoryKey = 'jeux';
$category = getCategory($categoryKey);
foreach ($category->pages() as $pageKey) {
$page = buildPage($pageKey);
$titre = substr($page->title(),1);
$tags = getTags();
foreach ($tags as $tag) {
if (($tag->name()) === 'CMS'){
echo $tag->list();																								}}}
but the problem is : list is a function , so how did i can do that ?
User avatar
diego
Site Admin
Posts: 773
Joined: Sat May 16, 2015 2:53 pm
Been thanked: 1 time
Contact:

You can use AJAX to get the content. here are some examples: https://github.com/bludit/examples/tree/master/api
viriisxp
Sr. Bludit
Posts: 33
Joined: Sat Jul 02, 2016 6:01 pm

hi again and thx for your answer, i will try this, but did you think that gonna work for tag ?
Post Reply