Reputation: 658
I'm new to magento theming, I have just finished my first theme. However a lot of the content is static on the pages. Such as some links in the footer, slider, etc. What would be the best way, in terms of distributing the theme to others, to have them edit this information in magento, either as a configuration area, static blocks, widgets, etc.
How would I make a static block and have it be installed in magento when the theme was installed?
How would you make an area in magento configuration where users can customize some options in your theme?
Upvotes: 1
Views: 182
Reputation: 1044
You probably know about the database install scripts you can create for a module inside the modules sql
directory, but from 1.6 CE up you can also create data install scripts inside the data
module directory which allows you to do exactly the kinds of things you want to on install - so you can use it to create a static block. There is a quick summary here. A limitation here is that the theme would be restricted to versions of Magento CE from 1.6 and up only. Also have a look at the data install scripts from the Mage_Cms module data directory in 1.6+.
Below 1.6 and you would have to manipulate the database directly using database install scripts which is not an elegant solution and I wouldn't recommend it.
With regards to having the user configure options for the theme, have a look at adding a system.xml
and optionally adminhtml.xml
(as this content can also be put into config.xml
) files into the modules etc
directory along with the config.xml
. system.xml
allows you to add new tabs and pages with configuration options into the system -> configuration section of admin, and adminhtml.xml
allows you to configure acl for those menu items. Have a look here.
Upvotes: 1