技术重要还是业务重要

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/

技术重要还是业务重要

技术重要还是业务重要_重要主题相关推荐

  1. 架构设计工作笔记003---中台概念_业务中台_数据中台_技术中台

    1.什么是中台,到底要解决什么问题? 这个最早由阿里在2015年提出的"大中台,小前台"战略中延伸出来的概念,灵感来源于一家芬兰的小公司Supercell--一家仅有300名员工, ...

  2. 区块链技术与溯源业务实践。_如何通过区块链技术丰富您的在线业务?

    区块链技术与溯源业务实践. It is believed that blockchain will radically change the economy of the country and th ...

  3. 张一鸣打造“抖音”等现象级产品的秘密:技术深度融合业务,引爆产品创新!...

    点击"技术领导力"关注∆  每天早上8:30推送 作者| Mr.K   编辑| Emma 来源| 技术领导力(ID:jishulingdaoli) 上一篇文章<对不起,世界上 ...

  4. 张一鸣打造“抖音”等现象级产品的秘密:技术深度融合业务,引爆产品创新!

    回到本文主题:技术融合业务,引领企业创新.我们以张一鸣如何孵化出抖音.今日头条等产品为例,聊一聊技术产品创新方法. 01 技术如何融合业务,引领企业创新? 抖音一开始并不叫抖音,而是a.me,后来用户 ...

  5. 软件架构设计 大型网站技术架构与业务架构融合之道

    前言 架构是一种综合能力,而不是某一方面的技能.也正因为如此,本书提供的是一个全面的解决方案.方法论.成体系的设计思维.因此,本书将从基础技术谈起,再到高层技术.再到业务.管理,提供一个架构能力的全局 ...

  6. 百度业务运营部_数据分析师(产品运营)岗位要求详解(1)

    首先,附上百度业务运营部_数据分析师(产品运营)岗位的招聘详情: 业务运营部_数据分析师(产品运营) 所属部门: 百度 工作地点: 北京市 招聘人数: 若干公 司: 百度 职位类别: 产品 发布时间: ...

  7. 用技术玩转业务增长 -- 增长黑客

    程序员有时候需要跳出代码,看看业务,思考业务 带着业务的视野,返回来思考技术的运用 最新最好的技术用在锋利的增长刀刃上,业务将无往不利 Growth这个事情,说他是技术,可是掰开了揉碎了,细节说透了, ...

  8. 计算机三级网络技术打印,全国计算机等级考试三级网络技术历年真题(整理_打印版)...

    全国计算机等级考试三级网络技术历年真题(整理_打印版) 2010年3月计算机等级考试三级网络笔试试题 一.选择题(每小题1分,共60分) 下列各题A).B).C).D)四个选项中,只有一个选项是正确的 ...

  9. 董长青(1980-),男,北京卡达克数据技术中心软件业务本部高级工程师,主要研究方向为大数据、车联网。...

    董长青(1980-),男,北京卡达克数据技术中心软件业务本部高级工程师,主要研究方向为大数据.车联网.

最新文章

  1. Exchange服务器系列课程之六--维护邮件服务器(一)
  2. 高并发系统设计的 2 个要点,一定要看!
  3. Python+Anaconda+PyCharm的安装和基本使用
  4. 最大的脚本网站_网站页面性能优化注意事项
  5. python和java哪个好学-java和python哪个的前途更好?
  6. 《数据结构和算法》之中缀表达式、后缀表达式转换
  7. 使用sklearn出现错误:ValueError: Expected 2D array, got 1D array instead 解决方法
  8. 随机测试数据生成 与 Pandas迭代方法性能对比
  9. Windows安装证书
  10. FFmpeg一些感想
  11. 什么叫北上资金,北向资金什么意思?
  12. 跨境电商“独立站”新风口丨从0-1答疑解惑篇
  13. 宝山区企业技术中心、区级工程技术研究中心给予奖励20万元
  14. linux网络接口是什么,网络接口是什么?What Is A Network Interface?--用Enki学Linux系列(1)...
  15. 线上推广渠道有哪些?如何进行管理?
  16. 青龙面板 Bot配置教程
  17. IOS14桌面布局图片怎么设置
  18. win7使用网卡开启WIFI功能
  19. 道路交通安全改善解决方案PPT
  20. 计算机毕业设计ssm水果生鲜销售系统7826c系统+程序+源码+lw+远程部署

热门文章

  1. 第六课:图层蒙版和快速蒙版
  2. 【若泽大数据】MySQL命令详解
  3. person search代码使用小教程
  4. 【CVPR2022】Detecting Camouflaged Object in Frequency Domain
  5. 【整理】扩频及CDMA知识点
  6. ReID中PCB模型输出维度_小白入门系列—— ReID(三):进阶:学习分块局部特征
  7. cpu空载50度_高性价比6热管全镀镍CPU散热器来了 超频三东海风云GI-R66U体验
  8. 在 Windows 中打开蓝牙设备
  9. dingding钉钉 python接口
  10. arduino 计时器和中断