Alternate home pages
Permalink
Is there a way do designate the home page in c5, I have been trying to build out some templates and have alternate home page layouts so the end user can pick a homepage layout.
Any ideas or solutions for this.
Any ideas or solutions for this.
I planned on having the pages pre-built with content, under the home nav using the same page type the difference being the block content.
Could I set a custom page attribute and do a header re-direct to that page attribute or something.
Could I set a custom page attribute and do a header re-direct to that page attribute or something.
pre built with content, do you mean like static content, or like you were gonna create and add content to the pages as you would with other pages on the site? (using blocks, etc...)
Are you planning on packaging this? Because there's tons of things you can do with during the package install process when you tap into c5's API.
What I wanted to do was create a theme with multiple homepage layouts similar to sites in theme forest and basically have them include custom layouts and unique blocks already on the page then somehow specify which one the user wanted as his active home page.
It's probably overkill, but you could create a theme config page in the dashboard.
The only reason why I wouldn't agree with multiple page_types is because that could get messy really quick.
If it is only the home page, why not just make multiple themes that all get installed at the same time?
The only reason why I wouldn't agree with multiple page_types is because that could get messy really quick.
If it is only the home page, why not just make multiple themes that all get installed at the same time?
I think it would also be messy creating more themes, I am almost adding a config to the site map or adding it to the dashboard.
This introduces an interesting concept. Might make for a great way to extend the Theme Customization page in the dashboard. That way there are standards in place, and there isn't an extra page on the Dashboard nav menu when you aren't using the theme.
I would still go with the user attribute and multiple home page types. you can then either hard code the blocks you want into the page types or code them to pull from the scrapbook. the later would still give you the ability to edit/change/move the blocks that show up on the page.
I am still thinking of packaging a block, that adds a page to the site map that lets a user pick any page to be the home page of the site and setting a redirect to that page.
That's certainly an option. You wouldn't need a block though.
What you could do is create a Select attribute with the appropriate values and then have it redirect based on the selected value. They would be forced to change it from the Sitemap, but they'd have to go the Dashboard either way.
What you could do is create a Select attribute with the appropriate values and then have it redirect based on the selected value. They would be forced to change it from the Sitemap, but they'd have to go the Dashboard either way.
why would they be forced to change it in the dashboard? Wouldn't it be best to set it up as a user attribute which is editable on there profile page? I mean from my understanding the "users" of this scenario are just registered users, not necessarily users with dashboard access, am I wrong?
I must have missed something thing. I wasn't aware this was "registered user" specific. In that case, I would say definitely make it a User Attribute and redirect that way.
I was simply looking for a way to let the site admin set an alternate home page.
Ok, if it's site admin only, then I would just make a new Collection(Page) Attribute.
Uh, isn't this essentially targeted content for specific user groups? Could be a combination of advanced permissions and the Targeted Content add on:
http://www.concrete5.org/marketplace/addons/targeted-content/...
Maybe this is a six in one, half a dozen in the other scenario--or I could just be missing the mark entirely...
http://www.concrete5.org/marketplace/addons/targeted-content/...
Maybe this is a six in one, half a dozen in the other scenario--or I could just be missing the mark entirely...
nah, no need to purchase a addon for something simple like this, it's only a matter of site configuration and a little bit of coding within the theme or modification of header_required file.
I also think that page types would be a good solution,
You could set up different areas on the home page and pull that content in from the scrapbook.
Different Page Types would allow the different layouts of the content and if you specify those areas where you want you new content, or where you want to hide content(remove the area)
That way you can change the home page layout from the home page and see what it looks like whilst still on the page.
That is if you would like the home page to be the alternate version for everybody and not just user specific
You could set up different areas on the home page and pull that content in from the scrapbook.
Different Page Types would allow the different layouts of the content and if you specify those areas where you want you new content, or where you want to hide content(remove the area)
That way you can change the home page layout from the home page and see what it looks like whilst still on the page.
That is if you would like the home page to be the alternate version for everybody and not just user specific
One bit of code I am quite fond of using now is the following
It Looks in the scrapbook for a block, if it does not find it it displays an area. With this I can often add content to areas of my choice of add a global block.
It could be modified further to display the area over the Global block if blocks existed within the area or even based on a user/page attribute
It Looks in the scrapbook for a block, if it does not find it it displays an area. With this I can often add content to areas of my choice of add a global block.
It could be modified further to display the area over the Global block if blocks existed within the area or even based on a user/page attribute
$a = new Area('Slogan'); $block = Block::getByName('Header_Slogan'); if( $block && $block->bID ) $block->display(); else $a->display($c);
These solutions could work the only reason I wanted to not go this route is I wanted to use layouts vs areas so the end user would have more flexibility.
hope this makes sense, and helps you out!