CW Quick Blocks Component
Create a CW Quick Blocks menu item
- Open a menu in the menu manager.
- Click the New button to add a CW Quick Blocks menu item to one of your menus.
- Set the menu item type to CW Quick Blocks > Blocks
- In the "CW Quick Blocks" tab in the menu item editor, take note of the "Position Prefix" or set your own. By default, it is set to "blocks". You can leave it as that if you want.
- Save and close the menu item.
- Go to the module manager.
- Add a module of any type you need.
- For "Position" in the module you added in step 7, follow the pattern of {POSITION_PREFIX}_{ROW}_{COLUMN}. For example, if you want to put the module in row 1, column 1, and the position prefix you set in step 4 above is "blocks", you would set "Position" to "blocks_1_1". If you changed the "Position Prefix" in step 4 to something other than "blocks", use that instead of "blocks" in the position name.
- Make sure that the module is published to the right page in the "Menu Assignment" tab.
- Save and close the module.
- Repeat steps 7-10 for all the modules you want to add to the page you created in steps 1-5.
Parameters Explained
- Template Override: A template override is an override of the default CW Quick Blocks layout file that you create within your template. This parameter will list the available template overrides. Note that if you add an override to your template called
default.php
, you don't have to select an override here because the system uses your template override automatically. - Position Prefix: Each module position loaded via com_cw_quickblocks will be named with the pattern {Position Prefix}_{Row}_{Column}. So, for example, if your position prefix is "blocks", then the module position in row 1, column 1 will be named
blocks_1_1
. - Number of Rows: Think of the module positions loaded in a com_cw_quickblocks page as the cells an Excel spreadsheet. The component will loop through the number of rows and columns set in the parameters to load the positions. This sets the number of rows to use.
- Number of Rows: This sets the number of columns to use.
- Module Chrome: This sets the module chrome style to use when rendering the mdoules in the com_cw_quickblocks layout.
Creating a Template Override
If you want to override the default layout, you have to create a template override as follows:
- Create the following directory in your template:
/templates/{YOUR_TEMPLATE}/html/com_cw_quickblocks/blocks
. You might first need to create thehtml
andcom_cw_quickblocks
directories. - Copy
/components/com_cw_quickblocks/views/blocks/tmpl/default.php
to/templates/{YOUR_TEMPLATE}/html/com_cw_quickblocks/blocks/default.php
* - Modify as needed
* Note: If you want to have multiple template overrides, you can create multiple copies of default.php
, but give it different names. Each new override will be available in as an option in the Template Override parameter in the menu item.
CW Quick Blocks Module
Add a CW Quick Blocks module to any page(s) on your site
- In the Joomla administrator, go to Extensions > Modules and click "New" to add the Quick Blocks Module to a page on your site in any position.
- Select the CW Quick Blocks module type.
- In the Quick Blocks Module's parameters, there is a parameters called "Module Position". You can set this to any value you want, but to keep it simple, let's just put the word "quickblocks" for this parameter. The other parameters are optional.
- Make sure that it is published to the right page(s) in the "Menu Assignment" tab.
- Save and close the module.
- Add another module of any type you need (not necessarily a Quick Blocks Module).
- For "Position" in the module you added in step 6, type "quickblocks" (or whatever position name you set in step 3 above) to publish it to the position we set in step 3.
- Make sure that it is published to the right page(s) in the "Menu Assignment" tab.
- Save and close the module.
- Repeat steps 6-9 for all the modules you want to add to the position you set in step 3 above.
Parameters Explained
- Module Position: Enter the name of the module position to render in this module. Please note that you must also set a position in which to display this module.
- Alternative Layout: There are 4 layouts that come with CW Quick Blocks: Default, Accordion, Carousel, and Tabs. You can also create template overrides within your template. This parameter will list the available template overrides.
- Module Style: Enter the module chrome style to use for the modules loaded in this module. Please note that you must select a style from the active template.
- Backgroun Image: Select or upload an image that will automatically be inserted as an inline style for the wrapping div element.
Creating a Template Override
If you want to override any of the 4 standard layouts, you have to create a template override as follows:
- Create the following directory in your template:
/templates/{YOUR_TEMPLATE}/html/mod_cw_quickblocks
. You might first need to create thehtml
directory. - Copy
/modules/mod_cw_quickblocks/{FILENAME}.php
to/templates/{YOUR_TEMPLATE}/html/mod_cw_quickblocks/{FILENAME}.php
* - Modify as needed
* Note: If you want to have multiple template overrides, you can create multiple copies of {FILENAME}.php
, but give it different names. Each new override will be available in as an option in the Alternate Layout parameter in the module.