Themes : Questions
Permalink
Hi all, so im new to C5 and i have a question
Im setting up areas in my theme and i would like to know if there is a way to set default content for an area
for example i could setup an area like so
<?php
$sn = new Area('Shiping_Notice');
$sn->display($c);
?>
Im wondering if there could be a way to do something like so
<?php
$sn = new Area('Shiping_Notice');
$sn = 'some html or content here' or perhaps an include
$sn->display($c);
?>
and by doing so, i would hardcore some default content.
Im setting up areas in my theme and i would like to know if there is a way to set default content for an area
for example i could setup an area like so
<?php
$sn = new Area('Shiping_Notice');
$sn->display($c);
?>
Im wondering if there could be a way to do something like so
<?php
$sn = new Area('Shiping_Notice');
$sn = 'some html or content here' or perhaps an include
$sn->display($c);
?>
and by doing so, i would hardcore some default content.
that's interesting.... why would i use global areas over say includes, or stacks?
I'll definitly check them out.
But i still have the question..... let me expand a little, let's say im working on a theme, and i want to populate the theme's content with lorem ipsum you know to keep the form of the site, without employing Css that could in some cases cripple my theme.
So how would I do that, but still allow the user to replace the content in the area, with a block or what not.... i quess it would be a "default" content type setting.
Thanks though for your pointers.
I'll definitly check them out.
But i still have the question..... let me expand a little, let's say im working on a theme, and i want to populate the theme's content with lorem ipsum you know to keep the form of the site, without employing Css that could in some cases cripple my theme.
So how would I do that, but still allow the user to replace the content in the area, with a block or what not.... i quess it would be a "default" content type setting.
Thanks though for your pointers.
I'm not sure exactly how to do it, but you can use the sample content add on in the marketplace to make an xml tree of the site structure, then set an option so that someone can choose to install sample content with the theme. This wipes out all the content on your site though.
And if you just want default content for this site, you can edit the defaults from the page types section of the dashboard, new pages will inherit the blocks set up there. You can also choose 'set up on child pages' from each block's context menu to apply it to pages already existing on your site.
So, instead of:
I would use this:
Then, you can add a simple content block with your content and it will display automatically anywhere you have this area.
Hope that helps?