技术重要还是业务重要_重要主题

news/2024/7/19 14:57:04 标签: html, css, java, js, opencv
htmledit_views">

技术重要还是业务重要

For some themed location /foo/bar, you want “bar” and everything below it to look different than “foo”.

对于某些主题位置/ foo / bar,您希望“ bar”及其下面的所有内容看起来都不同于“ foo”。

I had to do a bit of placeful theming lately and I thought I would share the techniques I used (thanks davisagli, jonbaldievieso, vedawms). Let’s say you have a Plone 3 site, and for some location /foo/bar/baz, you want ‘baz’ and everything below it to look different. I made this change through the web because I was in a hurry, but the same can be done in filesystem code.

最近我不得不做一些有意义的主题设计,我想我会分享我使用的技术(感谢davisagli,jonbaldievieso和vedawms)。 假设您有一个Plone 3网站,对于/ foo / bar / baz的某个位置,您希望“ baz”及其下面的所有内容看起来都不同。 我急着通过网络进行了更改,但是在文件系统代码中也可以这样做。

The steps are:

这些步骤是:

1.覆盖getSectionFromURL(导航到portal_skins / plone_scripts / getSectionFromURL并进行自定义) (1. Override getSectionFromURL (navigate to portal_skins/plone_scripts/getSectionFromURL and customize))

Normally, this bit of code returns the section id for whatever section you are in. So if your site has three top level folders A, B, C, getSectionURL returns section-A when you are inside of A, section-B when you are inside of B, and so on. However, when you are inside of a sub-section, e.g. /A/news-items-folder, it *still* returns the section id, in this case section-A. The override makes getSectionURL return the sub-section, e.g. /A/news-items-folder, or /foo/bar/baz.

通常,这段代码返回您所在区域的部分ID。因此,如果您的站点有三个顶级文件夹A,B,C,则当您位于A内时,getSectionURL返回A区域;当您位于B内时,SectionURL返回B区域。在B里面,依此类推。 但是,当您位于小节(例如/ A / news-items-folder)内时,它* still *会返回小节ID,在本例中为A节。 重写使getSectionURL返回子节,例如/ A / news-items-folder或/ foo / bar / baz。

 # Courtesy of jonb at onenw.org
# Courtesy of jonb at onenw.org
# getSectionFromURLcontentPath = context.portal_url.getRelativeContentPath(context)
# getSectionFromURLcontentPath = context.portal_url.getRelativeContentPath(context)
if if not not contentPathcontentPath :
    :
    return return None
None
elseelse :
    :
    s s = = ''
    ''
    sectionId sectionId = = ''
    ''
    for for pathItem pathItem in in contentPathcontentPath :
        :
        sectionId sectionId += += pathItem pathItem + + '-'
        '-'
        s s += += 'section-' 'section-' + + sectionIdsectionId [:[: -- 11 ] ] + + ' '
        ' '
        return return ss [:[: -- 11 ]
]

2.覆盖plone.logo(导航到/portal_view_customizations/zope.interface.interface-plone.logo并进行自定义) (2. Override plone.logo (navigate to /portal_view_customizations/zope.interface.interface-plone.logo and customize))

For some reason (good or not, I don’t know) Plone includes an image tag in the html code it uses to generate the Plone logo. This means that it will always output something like:

由于某种原因(无论好坏,我都不知道),Plone在用于生成Plone徽标的html代码中包含一个图像标签。 这意味着它将始终输出如下内容:

which is a problem if you want to placefully replace the logo because there is no easy way to do it (perhaps you could use some trick to return a different image file with the same file name).

如果您想替换掉徽标,这是一个问题,因为没有简单的方法可以这样做(也许您可以使用一些技巧来返回具有相同文件名的其他图像文件)。

Plone ships with:

Plone随附:

<a metal:define-macro="portal_logo" id="portal-logo" accesskey="1" tal:attributes="href view/navigation_root_url" i18n:domain="plone">
    <img src="logo.jpg" alt="" tal:replace="structure view/logo_tag" /></a>
<a metal:define-macro="portal_logo" id="portal-logo" accesskey="1" tal:attributes="href view/navigation_root_url" i18n:domain="plone">
    <img src="logo.jpg" alt="" tal:replace="structure view/logo_tag" /></a>

Replace that with:

替换为:

3.添加CSS(导航到/portal_skins/plone_styles/ploneCustom.css并进行自定义) (3. Add CSS (Navigate to /portal_skins/plone_styles/ploneCustom.css and customize))

Next, add in some CSS to make use of the previous two changes:

接下来,添加一些CSS以利用前两个更改:

body.section-foo-bar-baz { background-image: url(gradient.png);}.section-foo-bar-baz
#portal-globalnav li a { border: 0px; background: #0066CC; color: white; font-size: 110%; font-face: bold;}.section-foo-bar-baz
#portal-globalnav { background: #0066CC; padding: 0.25em;}.section-foo-bar-baz
#portal-breadcrumbs,.section-foo-bar-baz #portal-personaltools { background: white;}.section-foo-bar-baz
#portal-top { background: white;}.section-foo-bar-baz
#portal-logo { margin: 1em; background-image: url(ama_logo.gif); background-repeat: no-repeat;}.section-foo-bar-baz
#visual-portal-wrapper { background: white; margin: auto; width: 883px; position: relative;}.section-foo-bar-baz
body { background-image: url(gradient.png); background-repeat: repeat;}
#portal-logo { margin: 1em; background-image: url(logo.jpg); background-repeat: no-repeat;}
#portal-logo a { display: block; width: 650px; height: 80px;}
body.section-foo-bar-baz { background-image: url(gradient.png);}.section-foo-bar-baz
#portal-globalnav li a { border: 0px; background: #0066CC; color: white; font-size: 110%; font-face: bold;}.section-foo-bar-baz
#portal-globalnav { background: #0066CC; padding: 0.25em;}.section-foo-bar-baz
#portal-breadcrumbs,.section-foo-bar-baz #portal-personaltools { background: white;}.section-foo-bar-baz
#portal-top { background: white;}.section-foo-bar-baz
#portal-logo { margin: 1em; background-image: url(ama_logo.gif); background-repeat: no-repeat;}.section-foo-bar-baz
#visual-portal-wrapper { background: white; margin: auto; width: 883px; position: relative;}.section-foo-bar-baz
body { background-image: url(gradient.png); background-repeat: repeat;}
#portal-logo { margin: 1em; background-image: url(logo.jpg); background-repeat: no-repeat;}
#portal-logo a { display: block; width: 650px; height: 80px;}

I hope this helps someone get started with placeful theming.

我希望这可以帮助某人开始进行场所主题化。

翻译自: https://www.pybloggers.com/2008/06/placeful-theming/

技术重要还是业务重要


http://www.niftyadmin.cn/n/981595.html

相关文章

群发quota报警邮件脚本

群发quota报警邮件脚本1、是群发邮件&#xff08;通过cat /log/aspera/warn_mail.txt调用&#xff09;2、在邮件内容前增加自定义的3行&#xff08;sed -e 1i Hi All,&#xff1a;在第1行前增加“Hi All,”&#xff1b;sed -e 2G&#xff1a;在第2行前增加空行&#xff09;3、m…

Window 10备份与恢复

Window 10备份与恢复 实验案列&#xff1a;使用Ghost备份/恢复操作系统 实验环境 在VMware虚拟机15.0中操作 操作步骤 1.为Windows 10样机安装“一键Ghost 硬盘版”。 2.制作Windows 10操作系统备份镜像 。 3…在其他Windows 10主机中&#xff0c;使用备份的Ghost镜像文件恢复…

MongoDB 安装、主从配置、以及监控

1、安装#添加安装源[mongodb] nameMongoDB Repository baseurlhttp://downloads-distro.mongodb.org/repo/redhat/os/x86_64/ gpgcheck0 enabled1#yum 安装yum install -y mongo-10gen mongo-10gen-server#添加到开机自动启动chkconfig mongod on2、启动&#xff0c;停止&#…

js-权威指南学习笔记13

第十三章 Web浏览器中的JavaScript 1、在客户端JS中&#xff0c;window对象也是全局对象。 2、window对象中其中一个最重要的属性是document&#xff0c;它引用Document对象。 3、JS代码可以通过把函数赋值给Element对象的属性来注册事件处理程序。 4、单线程执行是为了让编程更…

3dmax水龙头_收回水龙头

3dmax水龙头Promote tap water over bottled water 在瓶装水上推广自来水 ACLARK.NET, LLC is proud to announce http://www.takebackthetap.org. ACLARK.NET&#xff0c;LLC很荣幸地宣布http://www.takebackthetap.org 。 The following software was used to deploy this …

VMware虚拟机安装CentOS 7.6图文教程与连接SecureCRT

VMware虚拟机安装CentOS 7.6图文教程与连接SecureCRT 实验环境 CentOS 7.6镜像文件 虚拟机 链接&#xff1a;镜像文件 提取码&#xff1a;8jfi 点击百度网网盘链接下载CentOS 7.6 镜像 方法/步骤 1.点击新建虚拟机 这里我用的是VMware 15&#xff0c;版本不同步骤差不多 2. …

C# DESC加密

DESC加密方法 直接上代码&#xff1a; 1、加密 /// <summary>/// 加密/// </summary>/// <param name"obj"></param>/// <returns></returns>public static string EncryptParameter(object obj){if (obj null){return "&…

裸体克隆主题

Products.naked_plone Products.naked_plone I’ve needed this for some time, but I’m finally getting around to shipping it. 我已经用了一段时间&#xff0c;但终于可以开始运送它了 。 In addition to making it easy to disable default Plone styles, this add-on …