echo out page descsription
Permalink
Hello - i need to echo out the page description of a site and i need to add it to a view.php file - how would you do this ?
How this will work is i add a new page and a description for that page. Then on that page i will add a block (a designer content block) and in that blocks view.php i need a code so it will echo out the page description.
i found this code
but nothing shows even though i have made a description when i added the new page... I add a block (designer content) to the page with the description and its also that blocks view.php file i gave the code to echo out the description.
Im really newbie with coding stuff like this, so any help would be appreciated.
thank you.
How this will work is i add a new page and a description for that page. Then on that page i will add a block (a designer content block) and in that blocks view.php i need a code so it will echo out the page description.
i found this code
<?php echo $c->getCollectionDescription() ?>
but nothing shows even though i have made a description when i added the new page... I add a block (designer content) to the page with the description and its also that blocks view.php file i gave the code to echo out the description.
Im really newbie with coding stuff like this, so any help would be appreciated.
thank you.
Hello,
If i undestand, you want echo current page description by calling $c->getCollectionDescription() within a block view.php (like content block) ?
mOoSh
If i undestand, you want echo current page description by calling $c->getCollectionDescription() within a block view.php (like content block) ?
mOoSh
yes exactly... How this will work is i add a new page and a description for that page. Then on that page i will add a block (a designer content block) and in that blocks view.php i need a code so it will echo out the page description.
before that, try putting:
$c = Page::getCurrentPage();
like this?
EDIT: this wont work :( - thank you for trying though... anyone else have a suggestion?
<?php $c = Page::getCurrentPage(); echo $c->getCollectionDescription()?>
EDIT: this wont work :( - thank you for trying though... anyone else have a suggestion?
you my hero... the last one worked. Thank you so much!!! Last request is to add a class arround the text, how would you then do that? or just a p tag...?
is that ok?
<p class="test"><?php $v = View::getInstance(); echo $v->getCollectionObject()->getCollectionDescription(); ?></p>
is that ok?
no problem ! :p
You can wrap code with p, span, div tags (any html element you want)
You can wrap code with p, span, div tags (any html element you want)
Thanks - helpful for me also.
Nobody know how to do this?