Giter Club home page Giter Club logo

hypeembed's Introduction

hypeEmbed

Elgg 2.3

Features

  • Replaces core embed UI/UX
  • Search, upload and embed files on the spot
  • Search and embed all other registered object types on the spot
  • Embed URL previews and rich-media players
  • [admin] Embed buttons that match the site styles
  • [admin] Embed "insecure" HTML embeds (forms, calendars etc)

Acknowledgements

  • Upgrade for Elgg 2.3 has been sponsored by ApostleTree, LLC

Embed Popup

Shortcodes

The plugin supports the following shorcodes:

ebmed shortcode:

  • guid - GUID of an entity to embed

player shortcode:

  • url - URL of the player

button shortcode:

  • text - call to action
  • type - One of the following types action, submit, delete, cancel (these values only affect styling and do not carry any functional value)
  • url - URL to link to
  • target - Default self, blank or lightbox

Examples:

[embed guid="555"]
[player url="http://youtube.com/893dkeie9"]
[button type="action" text="Read Terms" url="/terms" target="lightbox"]

Unlisted shortcode attributes will be parsed and passed to the view after sanitization, so extending plugins can add additional options.

By default, only shortcodes passed to output/longtext view will be expanded automatically. You can manually expand shortcodes using hypeapps_expand_embed_shortcodes($text).

You can strip shortcodes (e.g. when displaying a summary), using hypeapps_strip_embed_shortcodes($text).

Static assets

If you are using the same images across multiple posts, you may way to use static assets, as they allow you to take advantage of simplecache, thus offering better performance than file entities.

Create a folder in your dataroot /embed/ and place your image files in there, flush the caches, and you will see your images in the Assets tab of the embed lightbox window.

Notes

To disabled embeds on a particular field:

echo elgg_view_field([
    '#type' => 'longtext',
    'embeds' => false, // This disables the embeds
]);

If using the form that allows embed in a lightbox, you must open your lightbox with trapFocus option disabled, otherwise the forms within embed popups won't work.

require(['elgg/lightbox'], function(lightbox) {
	lightbox.open({
	    trapFocus: false,
	});
});
echo elgg_view('output/url', [
    'url' => 'some-form',
    'class' => 'elgg-lightbox',
    'elgg-colorbox-opts' => json_encode(['trapFocus' => false]),
]);

hypeembed's People

Contributors

hypejunction avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.