Using Dynamic Attributes in Content block?
Permalink
I want to create a Page Type which includes a default 'Content' block, but I'd like this content block to dynamically pull in the 'Title' from the page, i.e...
"This page is for ##PAGE TITLE HERE##".
Is this possible OOTB?
"This page is for ##PAGE TITLE HERE##".
Is this possible OOTB?
As far as I know, this isn't possible. Most people would use $c->getCollectionName() in their templates, I think...
Thanks akodde, such a shame as this is such a basic feature for a CMS :(
If you really want this you'd override the 'composer.php' from the Content block. Then check $this->field('content'). If it's empty, give it the text you want.
Hi Akodde,
I'm now using your suggested string of code to display the values chosen for the page from a 'Select' type attribute, however its being returned as a standard string, not an array, and without delimiting, for instance.
value 1 value 2 value 3
Is there anyway that I can alter this to return comma separated?
I'm now using your suggested string of code to display the values chosen for the page from a 'Select' type attribute, however its being returned as a standard string, not an array, and without delimiting, for instance.
value 1 value 2 value 3
Is there anyway that I can alter this to return comma separated?
I have tried that, replacing the 'attribute_handle' with the name of my attribute, but I get the following error:
Just to confirm - this is a new 'pagetype' php that I have created, applied to a page, then ticked a few options in my custom attribute (of type 'select').
Thanks for your help so far!
Warning: implode(): Invalid arguments passed in /home/siteaddress/themes/themeaddress_v1/pagetypeaddress.php on line 48
Just to confirm - this is a new 'pagetype' php that I have created, applied to a page, then ticked a few options in my custom attribute (of type 'select').
Thanks for your help so far!
Ah wait, my bad.
This is probably the code you're looking for:
http://www.weblicating.com/doku/doku.php?id=cheatsheet/#display_get...
This is probably the code you're looking for:
http://www.weblicating.com/doku/doku.php?id=cheatsheet/#display_get...
I did try this one this morning, but it returns all values from the Attribute, and I only wish to display the values selected/checked under the Page Properties for the attribute.
Guess what I just found!!
http://www.concrete5.org/marketplace/addons/attribute-displayer/...
And this one too!
http://www.concrete5.org/marketplace/addons/page-properties/...
Will give them a go and report back.
FREE too!
http://www.concrete5.org/marketplace/addons/attribute-displayer/...
And this one too!
http://www.concrete5.org/marketplace/addons/page-properties/...
Will give them a go and report back.
FREE too!
This add-on will accomplish what you are looking for:
http://www.concrete5.org/marketplace/addons/magic-data/...
http://www.concrete5.org/marketplace/addons/magic-data/...
As @enlil says, pulling in page properties and attributes to a content block is easy with Magic Data.
If it is just an initial heading you want to reflect the page title, you could also look at my Magic Heading block.
http://www.concrete5.org/marketplace/addons/magic-heading/...
Which to use depends on your overall requirement and what fringe benefits you can use.
Magic Heading also manages the page meta title and description that may be advantageous for SEO.
Magic Data can be useful for pulling in all sorts of data from user, products, files etc. and is the foundation for integrating information from and to many other addons.
If it is just an initial heading you want to reflect the page title, you could also look at my Magic Heading block.
http://www.concrete5.org/marketplace/addons/magic-heading/...
Which to use depends on your overall requirement and what fringe benefits you can use.
Magic Heading also manages the page meta title and description that may be advantageous for SEO.
Magic Data can be useful for pulling in all sorts of data from user, products, files etc. and is the foundation for integrating information from and to many other addons.