Gallery: 外观主题:有关嵌入的外观主题的思考:修订间差异

来自站长百科
跳转至: 导航、​ 搜索
(新页面: Gallery can be embedded within other applications, including content management systems (CMS) like Wordpress, Drupal, and Joomla, among others. This ability creates ...)
 
无编辑摘要
 
(未显示同一用户的1个中间版本)
第1行: 第1行:
Gallery can be embedded within other applications, including content management systems (CMS) like Wordpress, Drupal, and Joomla, [[Gallery:Embedding|among others]]. This ability creates feature-rich applications but presents certain user interface challenges for web designers. This section will discuss theme design and development considerations when integrating Gallery with other applications.
Gallery可以被嵌入到其他应用程序中,包括内容管理系统(CMS),如Wordpress,Drupal以及Joomla就是[[Gallery:Embedding|属于此类]]。Gallery能被嵌入应用程序中的这一能力兆示着特点丰富的应用程序的出现,但同样也为WEB设计者们提出了挑战,即特定用户界面的设计。此部分文章将讨论应Gallery与其他程序整合的需要所牵涉的外观主题的设计以及对开发的思考。


Gallery and the CMS in which it is embedded usually have similar interface components, such as sidebars, page titles, and breadcrumbs. Gallery integration developers have taken this fact into account during development. For example, the Gallery module for Drupal addresses repeated elements by stripping page blocks, like the sidebar, at runtime. Style sheets are also used to turn off the visual display of items through the CSS display property.
Gallery和其嵌入的对象CMS通常都具有相似的界面组件,比如边栏,页面标题和导航信标(breadcrumb)。Gallery整合开发者在开发过程中已经将此实际情况纳入考虑之中。比如,在运行时,Gallery的Drupal模块通过层剥页面区块来定位充分出现的元素,比如边栏。风格页也被通过使用CSS显示属性来关闭项目的可视化显示。


== General Theme Considerations ==
== 有关外观主题的一般考虑 ==


There are a few theme development and integration points that apply to all themes, regardless of the application with which Gallery is integrated.
且不论Gallery与何种应用程序整合,有一些开发及整合可用于所有外观主题。


=== Style Sheets ===
=== 风格页(Style Sheet) ===


Since both Gallery and CMS's are designed as stand-alone applications, their style sheets are developed to stand-alone. After embedding Gallery, it's not unusual to see inconsistent font properties, colors, and spacing issues. Gallery's style sheets are often called before the CMS, as they should be, and this means that CMS style definitions usually override or extend Gallery's styles definitions. Theme developers must edit the CMS and Gallery's style sheets to resolve CSS inheritance and specificity issues.
因为Gallery与CMS皆被设计为独立的应用程序,因此它们的风格页也是独立的。Gallery嵌入完成后,往往能发现不一致的字体属性,颜色以及间距问题。Gallery的风格页通常是,也是理所当然地,在CMS之前被呼叫的,这就意味着CMS的风格定义将会覆盖或扩展Gallery的风格定义。外观主题开发者需要对CMS及Gallery的风格页进行编辑来解决CSS继承性问题及特性方面的问题。


Theme designers should carefully consider where styles should be defined.
外观主题设计者应当慎重决定该在何处定义风格类型。




== Embedded-Only Style Sheets ==
== 仅供嵌入的风格页 ==


One method to resolve style conflicts in embedded galleries is to add an embedded style sheet to Gallery themes. This style sheet should be included in the theme only when Gallery is embedded and can adjust style declarations or hide Gallery theme elements altogether.
解决嵌入的gallery中风格冲突的一个办法就是向Gallery外观主题中添加一个嵌入的风格页。当Gallery被嵌入时,此风格页应仅被包含于外观主题中,这样就能调整风格声明或Gallery外观主题元素了。


To add an embedded style sheet, add the following to your theme's standardSettings array, contained in the theme.inc file:
要添加一个嵌入的风格页,将以下语句添加到外观主题的standardSettings数组中,此数组位于theme.inc文件之中:


<code>
<code>
第24行: 第24行:
</code>  
</code>  


Then add an isEmbedded check to your theme.tpl head area.
接着在theme.tpl头部区域中添加一个isEmbedded check。


<code>
<code>
第32行: 第32行:
</code>
</code>


Finally, create the embedded.css style sheet in gallery2/yourtheme/. The following is an example for a Drupal-embedded Gallery theme.
最后,在gallery2/yourtheme/中创建embedded.css风格页。以下为Drupal嵌入式的Gallery外观主题的例子。


<code>
<code>
   /* embedded styles */
   /* 嵌入的风格类型 */
    
    
   /* Zero out album and image container margins, let the CMS's CSS takeover */
   /* 取消相册和图片容器的边界,令CMS的CSS样式代之 */
   #doc3, #bd { margin: 0; padding: 0; }
   #doc3, #bd { margin: 0; padding: 0; }
    
    
   /* Let the CMS display item titles and breadcrumbs */
   /* 让CMS显示项目标题和导航信标(breadcrumbs) */
   .block-core-BreadCrumb, .giInfo h1 { display: none; }
   .block-core-BreadCrumb, .giInfo h1 { display: none; }
</code>
</code>


== Drupal Theme Considerations ==
== Drupal外观主题的相关思考 ==


== Wordpress Theme Considerations ==
== Wordpress外观主题的相关思考==


WordPress plugin specifically designed for Gallery: http://wpg2.galleryembedded.com
WordPress的插件是为Gallery量身定做的:http://wpg2.galleryembedded.com


== Joomla Theme Considerations ==
== Joomla外观主题的相关思考 ==


== Xaraya Theme Considerations ==
== Xaraya外观主题的相关思考 ==

2008年8月2日 (六) 14:36的最新版本

Gallery可以被嵌入到其他应用程序中,包括内容管理系统(CMS),如Wordpress,Drupal以及Joomla就是属于此类。Gallery能被嵌入应用程序中的这一能力兆示着特点丰富的应用程序的出现,但同样也为WEB设计者们提出了挑战,即特定用户界面的设计。此部分文章将讨论应Gallery与其他程序整合的需要所牵涉的外观主题的设计以及对开发的思考。

Gallery和其嵌入的对象CMS通常都具有相似的界面组件,比如边栏,页面标题和导航信标(breadcrumb)。Gallery整合开发者在开发过程中已经将此实际情况纳入考虑之中。比如,在运行时,Gallery的Drupal模块通过层剥页面区块来定位充分出现的元素,比如边栏。风格页也被通过使用CSS显示属性来关闭项目的可视化显示。

有关外观主题的一般考虑[ ]

且不论Gallery与何种应用程序整合,有一些开发及整合可用于所有外观主题。

风格页(Style Sheet)[ ]

因为Gallery与CMS皆被设计为独立的应用程序,因此它们的风格页也是独立的。Gallery嵌入完成后,往往能发现不一致的字体属性,颜色以及间距问题。Gallery的风格页通常是,也是理所当然地,在CMS之前被呼叫的,这就意味着CMS的风格定义将会覆盖或扩展Gallery的风格定义。外观主题开发者需要对CMS及Gallery的风格页进行编辑来解决CSS继承性问题及特性方面的问题。

外观主题设计者应当慎重决定该在何处定义风格类型。


仅供嵌入的风格页[ ]

解决嵌入的gallery中风格冲突的一个办法就是向Gallery外观主题中添加一个嵌入的风格页。当Gallery被嵌入时,此风格页应仅被包含于外观主题中,这样就能调整风格声明或Gallery外观主题元素了。

要添加一个嵌入的风格页,将以下语句添加到外观主题的standardSettings数组中,此数组位于theme.inc文件之中:

 'isEmbedded' => GalleryUtilities::isEmbedded()

接着在theme.tpl头部区域中添加一个isEmbedded check。

 {if $isEmbedded }
 <link href="{g->theme url="embedded.css"}" rel="stylesheet" type="text/css" media="screen" />
 {/if}

最后,在gallery2/yourtheme/中创建embedded.css风格页。以下为Drupal嵌入式的Gallery外观主题的例子。

 /* 嵌入的风格类型 */
 
 /* 取消相册和图片容器的边界,令CMS的CSS样式代之 */
 #doc3, #bd { margin: 0; padding: 0; }
 
 /* 让CMS显示项目标题和导航信标(breadcrumbs) */
 .block-core-BreadCrumb, .giInfo h1 { display: none; }

Drupal外观主题的相关思考[ ]

Wordpress外观主题的相关思考[ ]

WordPress的插件是为Gallery量身定做的:http://wpg2.galleryembedded.com

Joomla外观主题的相关思考[ ]

Xaraya外观主题的相关思考[ ]