Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision Next revision Both sides next revision | ||
services:pvw:conf:blocks [2015/03/16 10:47] r2d2 created |
services:pvw:conf:blocks [2015/03/17 17:48] r2d2 [Preset Blocks] |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Site Blocks ====== | ====== Site Blocks ====== | ||
- | {{indexmenu_n>20}} | + | Blocks are pieces of HTML code that you can add to either : |
+ | * The Home Page | ||
+ | * The Footer section of each page | ||
+ | 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> | ||
+ | |||
+ | Where : | ||
+ | * **TYPE** Is the blocks type and can either be **home** or **foot** | ||
+ | * **BLOCK_NAME** Is the name of a preset block or a custom block | ||
+ | |||
+ | The blocks will then be displayed in the order they are listed in the array. Example : | ||
+ | <code php> | ||
+ | $pvw_conf['blocks_on']['home']=array('carousel','jumbo','custom1'); | ||
+ | $pvw_conf['blocks_on']['foot']=array('boxes','custom2'); | ||
+ | </code> | ||
+ | |||
+ | |||
+ | |||
+ | ===== Preset Blocks ===== | ||
+ | We have created a few blocks that allow you to quickly add popular features to your Home Page or Footer. Here is the list of the actually available blocks : | ||
+ | * **carousel** Displays a pretty carousel of you 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, containing your SiteName and your Baseline. | ||
+ | * **jumbo2** : Same as "jumbo", but the block width is fitted inside a "container" DIV. | ||
+ | * **boxes** : Simple template to displays nice "[[boxes|boxes]]" speaded as columns. | ||
+ | * **custom** : Is used for custom HTML content. | ||
+ | |||
+ | |||
+ | |||
+ | ===== Custom Blocks ===== | ||
+ | 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 like this : | ||
+ | <code php>$pvw_conf['blocks']['NAME']['content']='YOUR_HTML';</code> | ||
+ | Where you'll need to replace : | ||
+ | * **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 right place to insert your own HTML code. | ||
+ | |||
+ | Example: | ||
+ | <code php>$pvw_conf['blocks']['custom_news']['content']=' | ||
+ | <div class="container"> | ||
+ | <H2>Analoger Just Released!<H2> | ||
+ | <a href="/products/p226-Analoger"><img src="/static/domain_name/img/analoger.jpg"></a> | ||
+ | </div>'; | ||
+ | </code> | ||
+ | |||
+ | Warning ! Like most languages, quotes or double quotes must be escaped from 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. | ||
+ | |||
+ | |||
+ | ===== 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: | ||
+ | * activate the preset block, ie the 'carousel'. | ||
+ | * copy its content from the generated HTML page source | ||
+ | * paste it in a custom block, ie 'custom_carousel' | ||
+ | * change it the way you want | ||
+ | * active this custom block and desactivate the preset you used as a start | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | {{indexmenu_n>20}} | ||