A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.mediawiki.org/wiki/Extension:CloudImage below:

Extension:CloudImage - MediaWiki

The CloudImage extension provides a way to embed images directly from image hosting services such as Flickr, OneDrive, Dropbox, SlideShare, Speaker Deck, imgur and others, via the ‎<cimg> tag, which functions similarly to the ‎<img> tag.

/* Extension:CloudImage */
IMG.cimg {
	max-width: 100%;
}
FIGURE.cimg {
	clear: both;
	margin: 2px;
	border: 1px solid #c8ccd1;
	background-color: #f8f9fa;
	font-size: 94%;
}
FIGCAPTION.cimgcaption {
	padding: 2px;
	text-align: left;
}

Note: You will need interface-admin permission to edit Common.css on MediaWiki 1.32 or above.

Simply add the tag with the image path specified in the "src" attribute. Remember to close the tag with "/>". For example:

<cimg src="https://example.com/image.jpg" width="600" />

Note: border="0" is set automatically if it is not specified.

Embed with caption[edit]

You can specify some attributes in a similar way to the ‎<img> tag.

You can use the "href" attribute to attach a hyper link to the image.

And you can also write a comment below the image.

For example:

<cimg src="https://example.com/sample.jpg"
	href="https://example.com/"
	width="400" height="300"
	title="test image"
	alt="test image"
	framestyle="clear: right; float: right;"
	captionstyle="text-align: right;">
comment here
</cimg>

Special attributes used here.

Embed from Dropbox[edit]

You can embed Dropbox image links directly. For example:

<cimg src="https://www.dropbox.com/s/9qwyhjuliy2whlu/18m4362_1920x1200.jpg?dl=0">[[w:Tadami Line|Tadami Line]] in winter</cimg>

You can embed images hosted on Flickr directly. For example:

<cimg src="https://www.flickr.com/photos/kimagurenote/26817918388/in/album-72157649433330773/">Photo from [[Flickr]]</cimg>

↓ embedding an image from Flickr directly ↓

This extension provides the tag ‎<flickr>, which is semi-compatible with Extension:FlickrAPI for migration.

To use this function, set the $wgCloudImageCompatibleFlickrAPI value above wfLoadExtension.

And set your Flickr API Key to $wgFlickrAPIKey. You can use the same key as in Extension:FlickrAPI.

/* Extension:CloudImage */
$wgCloudImageCompatibleFlickrAPI = true;
wfLoadExtension( 'CloudImage' );
$wgFlickrAPIKey = "(your api key set here)";

Note: This extension use Flickr API key with Extension:FlickrAPI (‎<flickr> tag) compatible mode only.

This extension uses MediaWiki's Object cache mechanism to save calls to Flickr API (excluding oEmbed).

If you use Extension:FlickrAPI compatibility mode, we recommend setting $wgMainCacheType.

And if you want to clear the cache, set the value in LocalSettings.php and reload the image.

$wgCloudImageCachingTime = false;

Note: Purging does not affect this extension.

By default, you can embed images from Flickr, OneDrive, Dropbox, Google Drive, SlideShare, Speaker Deck and imgur.

You can also add other sites if you wish.

$wgCloudImageAllowedDomains = [ "www.example.com", "image.example.net" ];

Note: This variable is changed in v1.1.4. The former format is no longer recommended.

By default, you can use the 'width', 'height', 'class', 'style', 'title' attributes.

You can also add other attributes if you wish.

e.g. adding 'id'

$wgCloudImageAllowedAttrs[] = 'id';

Alternatively, you can overwrite the setting to limit the list to specific attributes.

e.g. blocking 'class' and 'style'

$wgCloudImageAllowedAttrs = [ 'width', 'height', 'title', 'alt' ];

Note: Attribute values must be lowercase letters.

This extension refers to the value of $wgExternalLinkTarget.

$wgExternalLinkTarget = '_blank';

This extension supports the use of the lazy loading mechanism since v1.1.5.

You can set $wgNativeImageLazyLoading in LocalSettings.php if you want to use this function.

$wgNativeImageLazyLoading = true;

Note: This parameter is supported since MediaWiki version 1.34.0.

This extension is set to time out after 60 seconds when calling the Flickr API by default.

We recommend setting "default_socket_timeout" in php.ini as short as possible.

The Flickr oEmbed call times out after 2 seconds by default.

And you can change it as follows.

$wgCloudImageFlickrTimeout = 1.5;

You can use another tag e.g. ‎<img> as an alias.

To use this extension with ‎<img>, set the value above wfLoadExtension.

/* Extension:CloudImage */
$wgCloudImageTag = "img";
wfLoadExtension( 'CloudImage' );

Support for SlideShare (oEmbed), Speaker Deck (oEmbed) and imgur is experimental.

This extension poses a privacy risk. Only use it on private sites! For more details, see: Manual:$wgAllowExternalImages#Why disallow external images?


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4