Gallery:嵌入

来自站长百科
跳转至: 导航、​ 搜索

嵌入Gallery2

Gallery2可以完美地嵌入到你的网站中。你可以自定义一个已有的外观主题从而使得G2符合网站的外观风格。你还可以在功能上将G2整合到网站中。G2可以很轻易地被嵌入到其他的应用程序中。并且它还提供一个界面用来与网站/PHP运作的应用程序进行对话

可视化整合vs.功能性整合

如果你所需要的只是在网站中可视化地嵌入G2,比如在网站次级页面的顶部/左边/右边或中间添加菜单。那么你就只能在themes/matrix/templates/中编辑主要的主题模板,并通过调整CSS样式来确保字体大小和颜色的符合。

参见:外观主题向导 | 模板相关参考 | 指导 - 可视化整合

如果你想在网站的其他页面中放入随机的G2图片,你可以使用imageblock模块中的外部imageblock。

如果可视化嵌入不够的话,你需要整合G2的用户管理和验证系统以及使用另外一个PHP应用程序整合其他的部分。你还可以使用G2的GalleryEmbed class,它是介于G2和应用程序之间的一个界面,G2应该嵌入其中。

PHPNuke用户的另一选择就是使用IFRAME v1.0。只需极少的编辑你就可以将整个Gallery2置入一个(IFRAME)中并显示在主站中,且无须符合CSS或任何其他的网站特定信息。只须遵照软件包中的自述文件所述即可。

现有整合

多亏了这些勤恳的整合开发者们,才使得一些较完善的可用整合为我们所用。其中的绝大多数需要单独安装Gallery2和其他的应用程序(CMS,portal,forum和wiki等)并使用对应该应用程序的整合将二者连接起来。对于大多数应用程序来说,你可以使用module/extension/plugin,有些较为粗糙的则不是模组了并且需要你进行适当的编辑。但无论如何你都不应当编辑G2的文件。

参见:可用整合清单

Embedding Gallery in Other Applications

Gallery is designed specifically to manage your multimedia online. Gallery is not a content management system or a blog or a website editor. However, there's no reason why Gallery can't be the multimedia management portion of a much larger system which does much more context content management or blogging, etc. Many such systems focus on their core competency and provide a very weak multimedia management system. Gallery is designed to work within those larger systems and provide the functionality that they lack.

How we actually go about embedding Gallery into another program depends heavily on which program we are going to work with. More and more PHP based applications are modular and for these you can integrate G2 just by installing G2, the other application and additionally a module in that other application that integrates / wraps G2 into that application.

One of the most important goals when writing a (G2) integration should always be to make sure that no files have to be edited / replaced by the user. Only a very modular approach ensures that the user can maintain both applications independentely and upgrade quickly when a new (security) release is available for any of the 3 components (G2, emApp, and the integration).

See:

Also see: Embedding Development Roadmap

Short URLs in Embedded G2

Enabling short URLs (rewrite module) in embedded G2 is often not that easy. Therefore we have documented the necessary steps.

See: Configuring URL Rewrite for Embedded G2

Code Snippets

See: GalleryEmbed related Code Snippets