Include page properties in text block
Permalink
Hi, is it possible to include page properties in a tekst block?
I have a stack I want to include in various pages. The stack contains a default text, but I want it combined with the page properties. EG.
Default text: Nice to meet you + [PAGE TITLE PROPERTY]
So if the page name is, Jason, it should become:
Nice to meet you, Jason
Hope someone can help! Thanks
I have a stack I want to include in various pages. The stack contains a default text, but I want it combined with the page properties. EG.
Default text: Nice to meet you + [PAGE TITLE PROPERTY]
So if the page name is, Jason, it should become:
Nice to meet you, Jason
Hope someone can help! Thanks
You can append this code to your default text
Any reason that can't be simplified?
echo $c->getCollectionName();
Hi, thanks for the quick help. I'm probably doing it wrong. When I paste the code into the TEXT BLOCK using the SOURCE button, I still see code instead of result.
Also tried adding it to an HTML block.
Any tips? Thanks!
Also tried adding it to an HTML block.
Any tips? Thanks!
Though with that in mind, you could just add a 'Page Title' block.
What I want is to have a TEXT BLOCK with text like:
Hello, [TITLE OF THE PAGE], bla bla bla.
Hello, [TITLE OF THE PAGE], bla bla bla.
To add code, you would need to use either a php or code block (dangerous, but free in the marketplace), or create a new block view template for an existing block and add the code to the template.
If all you need is the page heading, then a page title block may be your easiest solution.
You could also look at the 'Page Attribute Display' block.
If all you need is the page heading, then a page title block may be your easiest solution.
You could also look at the 'Page Attribute Display' block.
I can't use the Page properties block, because I need the text and property to be a link.
EG:
I have a STACK that contains a text block with the text 'EMAIL NAME'. This needs to be a link to the contact page. All the pages that have this STACK will link to the SAME contact form, but I want the text to be different on all pages. EG. EMAIL JASON or EMAIL KATY of EMAIL AMANDA, etc.
The NAME must come form the page property.
EG:
I have a STACK that contains a text block with the text 'EMAIL NAME'. This needs to be a link to the contact page. All the pages that have this STACK will link to the SAME contact form, but I want the text to be different on all pages. EG. EMAIL JASON or EMAIL KATY of EMAIL AMANDA, etc.
The NAME must come form the page property.
You will need either a custom block or a custom template for one of the above blocks.
Your template would put your boilerplate text and link about the page title.
Your template would put your boilerplate text and link about the page title.
There is also a 'Shortcodes' addon https://www.concrete5.org/marketplace/addons/shortcodes...
, but you still need to supply the php to generate the inserted text.
Unless you have a lot of other uses for inerting stuff, stick with a custom template.
, but you still need to supply the php to generate the inserted text.
Unless you have a lot of other uses for inerting stuff, stick with a custom template.
Thanks man! I'll check it out ;)