FORUMS CLOSED DUE TO SPAM. YOU STILL CAN ADD POST!

Page list with page descriptions

Feed 4 posts, 3 voices

Avatar
25 posts

I made part called "desc" representing the description of each page. Now I want to make a sitemap and page list with the page description next to it.

Ex.

Home - homepage description here about - about page description article - article page description

etc.

How can this be done?

PS: The new site looks good!

 
Avatar
25 posts

Can some one help me out? Ive been waiting.

 
Avatar
541 posts

in the sitemap simply use: <?php echo $child->content('desc'); ?> where you want to add the description

 
Avatar
25 posts

Doesn't work. I dont now where to put it.

<?php function snippet_sitemap($parent) { $out = ''; $childs = $parent->children(); if (count($childs) > 0) { $out = '<ul>'; foreach ($childs as $child) $out .= '<li>'.$child->link().snippet_sitemap($child).'</li>'; echo $child->content('desc'); $out.= '</ul>'; } return $out; } ?> <div id="sitemap"> <?php echo snippet_sitemap($this->find('/')); ?> <?php echo $child->content('desc'); ?> </div>

 
Avatar
1493 posts

Try it this way:

<?php
function snippet_sitemap($parent)
    {
        $out = '';
        $childs = $parent->children();
        if (count($childs) > 0)
            {
                $out = '<ul>';
                foreach ($childs as $child)
                    $out .= '<li>'.$child->link().$child->content('desc').snippet_sitemap($child).'</li>';
                $out.= '</ul>';
            }
        return $out;
    }
?>

<div id="sitemap">
<?php echo snippet_sitemap($this->find('/')); ?>
</div>

The trick is to get the $child->content('desc') in the place where you want it.