Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
services:pvw:conf:blocks [2015/03/17 12:12] r2d2 [Custom Blocks] |
services:pvw:conf:blocks [2015/03/19 11:30] (current) r2d2 |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Site Blocks ====== | ====== Site Blocks ====== | ||
- | Blocks are some pieces of HTML code that you can add to either : | + | Blocks are pieces of HTML code that can be added to either : |
- | * the Home Page | + | * The Home Page |
- | * the Footer section of each page | + | * The Footer section of each page |
- | They are all OFF by default, and should be activated using the following syntax : | + | They are all OFF by default and should be activated using the following syntax : |
<code php>$pvw_conf['blocks_on']['TYPE']=array('BLOCK_NAME','BLOCK_NAME2');</code> | <code php>$pvw_conf['blocks_on']['TYPE']=array('BLOCK_NAME','BLOCK_NAME2');</code> | ||
Where : | Where : | ||
- | * **TYPE** is the blocks type, either **home** or **foot** | + | * **TYPE** Is the type of blocks that can either be **home** or **foot** |
- | * **BLOCK_NAME** is the name of a preset block or a custom block | + | * **BLOCK_NAME** Is the name of a "preset" or a "custom" block |
- | The blocks will then be displayed in the order they are listed in the array. Example: | + | The blocks will then be displayed in the order in which they are listed in the array. Example : |
<code php> | <code php> | ||
$pvw_conf['blocks_on']['home']=array('carousel','jumbo','custom1'); | $pvw_conf['blocks_on']['home']=array('carousel','jumbo','custom1'); | ||
Line 21: | Line 21: | ||
===== Preset Blocks ===== | ===== Preset Blocks ===== | ||
- | We have create some blocks that allow you to quickly add some popular features on your Home Page or Footer. Here is the list : | + | We have created a few blocks that allow you to quickly add popular features to your Home Page or Footer. Below is the list of the actually available blocks : |
- | * **carousel** Display a pretty carousel of you products. All options that can be changed are listed from your Private Area (see the [[site|Site configuration Basics]]) | + | * **carousel** Displays a pretty carousel of products. All options that can be changed are listed in your Private Area (see the [[site|Site configuration Basics]]) |
- | * **jumbo** : displays a full width Bootstrap "jumbotron" block, conatining your SiteName and your baseline. | + | * **jumbo** : Displays a full width Bootstrap "jumbotron" block, containing your SiteName and your Baseline. |
- | * **jumbo2** : same as "jumbo", but the block width is fitted inside a "container" DIV. | + | * **jumbo2** : Same as "jumbo", but the block width is inserted inside of a "container" DIV. |
- | * **boxes** : simple template to displays some "[[boxes|boxes]]" speaded as columns. | + | * **boxes** : Simple template to displays nice "[[boxes|boxes]]" spreaded as columns. |
- | * **custom** : for custom HTML content | + | * **custom** : Is used for custom HTML content. |
===== Custom Blocks ===== | ===== Custom Blocks ===== | ||
- | Apart from presets block, custom blocks allow you to create HTML content that you can insert among preset blocks. You have to define each custom block like that : | + | Apart from preset blocks, custom blocks allow you to create HTML content that you can insert among preset blocks. You'll need to define each custom block as follow : |
<code php>$pvw_conf['blocks']['NAME']['content']='YOUR_HTML';</code> | <code php>$pvw_conf['blocks']['NAME']['content']='YOUR_HTML';</code> | ||
- | Where you have to replace: | + | Where you'll need to replace : |
- | * **NAME** by the name of the custom block, starting with 'custom', ie:"//custom//", "//custom1//", "//custom_desc//" etc. Beware that this name is used in the CSS ID name and thus should only include letters, digits underscore or hyphen. (Don't put spaces in the name) | + | * **NAME** by the name of the custom block, starting with 'custom'. Example :"//custom//", "//custom1//", "//custom_desc//" etc. Note that this name is used in the CSS ID name and therefore should only include letters, digits, underscores or hyphens. (Never use spaces in the name) |
- | * **YOUR_HTML** is the place to put your own HTML code. | + | * **YOUR_HTML** is the right place to insert your own HTML code. |
Example: | Example: | ||
Line 45: | Line 45: | ||
</code> | </code> | ||
- | Beware that like in most languages, quotes or double quotes must be escaped in php strings depending on the enclosing quote type. (See [[http://php.net/manual/en/language.types.string.php|php string]]. If you have many quotes to escape, using the [[http://php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc|heredoc]] syntax might be a smarter workaround. | + | Warning ! Like most languages, depending on the enclosing quote type, quotes or double quotes should be escaped from the php strings. (See [[http://php.net/manual/en/language.types.string.php|php string]]. If you have many quotes to escape, using the [[http://php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc|heredoc]] syntax might be a smarter workaround. |
===== Customizing a Preset Block ====== | ===== Customizing a Preset Block ====== | ||
- | If you dont like the way a preset block is set, you can of course, use your own custom block, to rebuild it the way you want. You just have to: | + | If you dont like the way a preset block is set, you can use your own custom block to rebuild it at your convenience. You only need to: |
- | * activate the preset block, ie the 'carousel'. | + | * Activate the preset block like the 'carousel'. |
- | * copy its content from the generated HTML page source | + | * Copy its content from the generated HTML page source. |
- | * paste it in a custom block, ie 'custom_carousel' | + | * Paste it in a custom block, like 'custom_carousel' |
- | * change it the way you want | + | * Change it the way you want it to be. |
- | * active this custom block and desactivate the preset you used as a start | + | * Activate your custom block and deactivate the preset one you used at start. |
Line 61: | Line 60: | ||
{{indexmenu_n>20}} | {{indexmenu_n>20}} | ||
- |