Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 61 lines (42 sloc) 1.66 KB

Random

Released under the MIT license. Copyright (c) 2013 mcbSolutions.at

Version 0.2; Please report errors.

Add's random text and/or image to your site

Installation

  1. Copy/save the plugin into plugins folder
  2. Setup the $config['mcb_random'][] array; see description below how to do this

index.html

Use Twig value {{ random.txt1 }}, {{ random.txt2 }}, {{ random.txt1 }} wherever you want

Example 1

{% if is_front_page %}
	<p><cite>{{ random.txt1 }}</cite><br/>
		<sup class="floatRight">{{ random.txt2 }}</sup>
		{{ random.img }}
	</p>
{% endif %}

Example 2

{% if is_front_page %}
	<p>{{ random.txt1 }}{{ random.img }}</p>
{% else %}
	{{ random.txt2 }}
{% endif %}

config

mcb_random_img_path (optional)

string
Full path where the used images are located.
Default is $config['base_url'] . "/content/images/"

$config['mcb_random_img_path'] = $config['base_url'] . "/content/images/";

mcb_random_img_alt (optional)

string
Title and alternative text for images, when missing in configuration.
Default is ``.

	$config['mcb_random_img_alt'] = "Screen";

mcb_random

string
Semikolon separated values for random

	$config['mcb_random'][] = 'Text 1;Text 2;Image;Image title';

Note: You are able to add as many $config['mcb_random'][] = ... lines you like.

You can’t perform that action at this time.