如何在Plone5中移动搜索栏

时间:2018-03-21 12:49:37

标签: python plone plone-4.x plone-5.x plone-3.x

我是Plone 5的新手,我实际上是在跟踪plone训练。但是,我并不习惯所有人的构建方式。我想做一些简单的事情,但我不知道从哪里开始。例如:

  • 如何将搜索栏从标题移动到导航栏菜单?

  • 如何将图像添加到徽标旁边的标题中?

  • 有没有可以帮助我的教程?

2 个答案:

答案 0 :(得分:1)

您的大部分问题都可以通过官方教程和文档中的技巧来回答。参见:

答案 1 :(得分:0)

您可以在其中一个加载项的配置文件中添加protected override void RenderLabels(IRenderContext rc, OxyRect rect) { var clip = this.GetClippingRect(); int m = this.Data.GetLength(0); int n = this.Data.GetLength(1); double fontSize = (rect.Height / n) * this.LabelFontSize; double left = this.X0; double right = this.X1; double bottom = this.Y0; double top = this.Y1; var s00 = this.Orientate(this.Transform(left, bottom)); // disorientate var s11 = this.Orientate(this.Transform(right, top)); // disorientate double sdx = (s11.X - s00.X) / (m - 1); double sdy = (s11.Y - s00.Y) / (n - 1); for (int i = 0; i < m; i++) { for (int j = 0; j < n; j++) { var point = this.Orientate(new ScreenPoint(s00.X + (i * sdx), s00.Y + (j * sdy))); // re-orientate var v = GetValue(this.Data, i, j); var color = this.ColorAxis.GetColor(v); var hsv = color.ToHsv(); var textColor = hsv[2] > 0.6 ? OxyColors.Black : OxyColors.White; var label = this.Labels[i, j]; rc.DrawClippedText( clip, point, label, textColor, this.ActualFont, fontSize, 500, 0, HorizontalAlignment.Center, VerticalAlignment.Middle); } } } 来安装附加产品Products.ContentWellPortlets并用portlet替换top-viewlet。

此示例在其旁边添加徽标和图像:

portlets.xml

用一些造型打磨它。

对于搜索框,我可以在内容上方指定一个搜索portlet(使用ContentWellPortlets),给它一个减去margin-top的顶部,为globnav指定一个margin-right,但是因为罗马的方法有很多,我也可以用导航portlet替换globnav。

这是一个用于插图目的的附加组件(有关如何隐藏顶级视图,请参阅其<?xml version ="1.0"?> <portlets> <!-- Assign Logo-portlet to site-root (key='/'): --> <assignment name="top" category="context" key="/" manager="ContentWellPortlets.InHeaderPortletManager1" type="plone.portlet.static.Static" visible="True"> <!-- Give this portlet a name, so we can recognize it easily in the portlet-management-UI via `[PLONESITE_URL]/manage-portletsinheader`: --> <property name="header">Logo</property> <!-- But don't show its header and footer when viewing the portlet: --> <property name="omit_border">True</property> <!-- Replace 'Plone' with your site-id here, in case it differs: --> <property name="text"> &lt;a href="/Plone"> &lt;img src="logo.png" /> &lt;/a> </property> </assignment> <!-- Assign another portlet in next column (InHeaderPortletManager2): --> <assignment name="top" category="context" key="/" manager="ContentWellPortlets.InHeaderPortletManager2" type="plone.portlet.static.Static" visible="True"> <property name="header">Some image next to Logo</property> <property name="omit_border">True</property> <property name="text"> &lt;img src="defaultUser.png" title="Dummy-user-avatar" /> </property> </assignment> </portlets> ): https://github.com/ida/adi/tree/master/adi.samplestructure