Gallery:嵌入

来自站长百科
Firebrance讨论 | 贡献2008年7月17日 (四) 15:54的版本
跳转至: 导航、​ 搜索

嵌入Gallery2

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

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

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

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

If you also want to place some random images of G2 on other pages of your website, you can use the external imageblock from the imageblock module.

If visual embedding is not enough and you need to integrate G2's user management and authentication system and other parts with another PHP application, you can do that by using G2's GalleryEmbed class which is an interface between G2 and the application in which G2 should be embedded in.

Another option for PHPNuke users is to use IFRAME v1.0 which requires very little editing and you can place your entire Gallery2 inside of an (IFRAME) for display on your main site without having to match CSS or any other site specific information. Just follow the readme file included in the package.

Existing Integrations

Thanks to dedicated integration developers there are some more or less complete integrations available. For most of these you need to separately install Gallery 2 and the other application (CMS, portal, forum, wiki, ...) and then connect the two by using the integration for that application. For most applications you can use a module/extension/plugin, some less elaborate applications are not that modular and require that you edit some files. But you should never have to edit G2 files.

See: List of Available Integrations

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