Automaticly adding attibutes to page types?
PermalinkI will use concrete5's 'Page' type using default.php as an example.
When you do a fresh install of concrete5 there is a layout called 'Page'. If you chose to use the 'Page' layout when you create a new page it will automatically have 'exclude from nav' checked and you can enter meta data if you look under properties.
I have gotten this to work before, by creating a new page type, then the first thing I do is hit edit, pick which attributes I want to show and chose the thumbnail. Then save. After that I click on 'defaults' go to properties, set the attributes, (like custom class names, default header images etc.), maybe add a global content block, and save.
Then any page created with my new page type has all my settings. But for some reason I can't get this to work anymore. I have tried the above steps over and over.
Is there anyway this can be forced?
I fount this article:
http://www.concrete5.org/documentation/how-tos/developers/how-to-in...
But I stopped after reading 'package controller.' I am making a site theme not a package theme. Do all the same rules apply?
Can you create a controller file for themes or will this script be fine in the header?
Any help would be awesome.
Example, I create a new page type 'news' which uses default.php. Yay! works.
Then immediately, first thing i do without assigning, is hit edit->pick thumbnail, chose custom attributes I have made. Save. works-> Yay!
Then, click 'defaults' for the 'news' page type, go to properties-> check custom attributes like class name add image, add custom meta's whatever. save.
Now I create new page using 'news' layout. Nothing. Custom attributes are cleared of the defaults I set, I have add them back.
Setting 'Page Type'->'News->'defaults' is pointless if the defaults are not really defaults, I don't understand why it is not working. I have tried this path 5 times, maybe it is a bug because it worked with the ones I made BEFORE I activated the template.
I'm honestly not sure how you were getting default attributes before -- it's possible you had some kind of addon or something that did this?
You are right about this one, there does not same to be an easy way to include these. Looking at the tutorial again I think importing the attributes should work, I will just need to find time to try it.
Look for the Page Type that you wish to add blocks to as default, click on the button that says "Default" for the particular page type, a new window then opens up, you could add blocks as defaults also, add the custom attributes that you wish to see whenever a page with that particular Page type is created as defaults, save the changes and then try to create a new page with a particular page type that you set defaults for to see if you are getting the attributes or blocks that you set as defaults