Topic: Admin Reference Documentation

There are no links on your documentation page (http://monstra.org/documentation for admin items such as how to use Blocks, Snippets, etc. Is there any available documentation for these items?

Re: Admin Reference Documentation

Blocks/snippets has shortcodes which u can connect anywhere u want, u can make block with content "hello its me" and then get shortcode for block then for example go to pages - home page add shortcode in there and u will see that it showes on homepage "hello its me".

As an advance example u can create a side bar via block or snippet and then embet it via php short code in the index.template.php one located at ur theme folder on ur server wink

(с) Roman Art
So far So good wink

RomanArt's Website

Re: Admin Reference Documentation

Blocks and Snippets are ways to create reusable sections.  Use Blocks for HTML/text. Use Snippets for code -- PHP or Javascript.

For example, if you create a Block named 'example-block' with the following contents:

<h3>About Us</h3>
<img src="//placehold.it/200x200/000000/ffffff" alt="photo" />
<p>Lorem Ipsum. Lorem Ipsum. Lorem Ipsum. Lorem Ipsum. Lorem Ipsum. Lorem Ipsum. Lorem Ipsum. </p>

You could then include that Block of HTML on a page by either calling it in a template file via php:

<?php echo Block::get('example-block'); ?>

or putting a shortcode in the page editor

{block get="example-block"}

Calling via php in the template file will make it appear on any page that uses that template. By calling via the shortcode, it will only appear on the page on which you've inserted it in the editor.

The same process applies to Snippets:

<?php echo Snippet::get('example-snippet'); ?>
{snippet get="example-snippet"}

The advantage to using them is that they are easier to reuse if you choose to change your site template. Use via shortcode will remain unchanged.  Updating your template to use your Snippets (or Blocks) is faster and easier that editing those sections into the template files -- just figure out where you want to put that section and call the Snippet. It makes managing templates easier.  They're kind of like using <?php include ...

Cheers!

monstrahost's Website

Re: Admin Reference Documentation

Thats very helpful. Thank you!