Zwei verschiedene Logos in Plone

Django, Flask, Bottle, WSGI, CGI…
Antworten
JR
User
Beiträge: 286
Registriert: Montag 20. Februar 2006, 16:43
Wohnort: Berlin

Hallo!

Vielleicht geht es ja.

Ich adminitriere eine Plone-Site mit einem bestimmten Logo. Doch in einem bestimmten Verzeichnis der obersten Ebene (Portal-Tab) und darunter, soll ein anderes Logo erscheinen.
Weiß jemand, wie ich dies hinbekommen kann?

Ich bedanke mich im Voraus für jeden Tipp!

Viele Grüße aus Berlin
JR
Benutzeravatar
gerold
Python-Forum Veteran
Beiträge: 5555
Registriert: Samstag 28. Februar 2004, 22:04
Wohnort: Oberhofen im Inntal (Tirol)
Kontaktdaten:

JR hat geschrieben:in einem bestimmten Verzeichnis der obersten Ebene (Portal-Tab) und darunter, soll ein anderes Logo erscheinen.
Hallo JR!

Das Logo steht (ich glaube) in "public.css" definiert. Du musst nur die Logo-Einträge mit einem anderen CSS überschreiben.

Du könntest in den besagten Ordner eine "local.css" legen. In dieser überschreibst du die Logo-Einträge.
In der "header"-Vorlage könntest du dann in etwa so vorgehen:

Code: Alles auswählen

<style type="text/css" media="all" tal:condition="exists:context/local.css"
       tal:content="string:@import url(${context/local.css/absolute_url});">
</style>
mfg
Gerold
:-)
http://halvar.at | Kleiner Bascom AVR Kurs
Wissen hat eine wunderbare Eigenschaft: Es verdoppelt sich, wenn man es teilt.
JR
User
Beiträge: 286
Registriert: Montag 20. Februar 2006, 16:43
Wohnort: Berlin

Hi Gerold!

Also ich habe das Template /portal/portal_skins/plone_templates/header in den custom-Ordner kopiert.
Ich weiß nicht, wie ich deinen Codevorschlag dort einpflanzen kann.


In das ZMI-Verzeichnis, wo ich ein anderes Logo haben möchte, habe ich eine local.css angelegt. Sie hat folgenden Inhalt:

Code: Alles auswählen

#portal-logo {
    background: url(&dtml-portal_url;/&dtml-logoName2;) no-repeat;
    border: 0;
    margin: 0.75em 0em 0.75em 1.5em;
    padding: 0;
}
(Man beachte die 2 bei "&dtml-logoName2". Zu den base_properties habe ich einfach noch ein logoName2 angelegt und ein logo2.jpg angegeben, welches im custom-Ordner liegt.

Meintest du das so? Meine Frage ist wie gesagt, wie ich den <style> - Block in das benutzerdefinierte "header"-Template einbauen kann.

Viele Grüße
Jamil
JR
User
Beiträge: 286
Registriert: Montag 20. Februar 2006, 16:43
Wohnort: Berlin

Also ich habe im Template namens "header" einen passenden Block entdeckt:

Code: Alles auswählen

        <tal:block condition="not:nocall:css">
        <style type="text/css" media="all" tal:condition="exists:portal/base.css"
               tal:content="string:@import url($portal_url/base.css);">
        </style>
        <style type="text/css" media="all" tal:condition="exists:portal/columns.css"
               tal:content="string:@import url($portal_url/columns.css);">
        </style>
        <style type="text/css" media="all" tal:condition="exists:portal/public.css"
               tal:content="string:@import url($portal_url/public.css);">
        </style>
        <style type="text/css" media="all" tal:condition="exists:portal/portlets.css"
               tal:content="string:@import url($portal_url/portlets.css);">
        </style>
        <style type="text/css" media="all" tal:condition="exists:context/local.css" 
               tal:content="string:@import url(${context/local.css/absolute_url});"> 
        </style>

        </tal:block>
Leider geht es nicht :-(

Ich probiere es weiter...
Benutzeravatar
gerold
Python-Forum Veteran
Beiträge: 5555
Registriert: Samstag 28. Februar 2004, 22:04
Wohnort: Oberhofen im Inntal (Tirol)
Kontaktdaten:

JR hat geschrieben:

Code: Alles auswählen

        <tal:block condition="not:nocall:css">
        <style type="text/css" media="all" tal:condition="exists:portal/base.css"
               tal:content="string:@import url($portal_url/base.css);">
        </style>
        <style type="text/css" media="all" tal:condition="exists:portal/columns.css"
               tal:content="string:@import url($portal_url/columns.css);">
        </style>
        <style type="text/css" media="all" tal:condition="exists:portal/public.css"
               tal:content="string:@import url($portal_url/public.css);">
        </style>
        <style type="text/css" media="all" tal:condition="exists:portal/portlets.css"
               tal:content="string:@import url($portal_url/portlets.css);">
        </style>
        <style type="text/css" media="all" tal:condition="exists:context/local.css" 
               tal:content="string:@import url(${context/local.css/absolute_url});"> 
        </style>

        </tal:block>
Leider geht es nicht :-(
Hallo JR!

Der neue Block muss darunter hin, sonst wird er nicht angezeigt.

Code: Alles auswählen

    <metal:css tal:define="css nocall:here/renderAllTheStylesheets|nothing">
	<tal:block condition="nocall:css">
          <metal:block metal:use-macro="css/macros/cssrenderer">
            <!-- Fetch stylesheets from the CSS Registry -->
          </metal:block>
        </tal:block>
        <tal:block condition="not:nocall:css">
        <style type="text/css" media="all" tal:condition="exists:portal/base.css"
               tal:content="string:@import url($portal_url/base.css);">
        </style>
        <style type="text/css" media="all" tal:condition="exists:portal/columns.css"
               tal:content="string:@import url($portal_url/columns.css);">
        </style>
        <style type="text/css" media="all" tal:condition="exists:portal/public.css"
               tal:content="string:@import url($portal_url/public.css);">
        </style>
        <style type="text/css" media="all" tal:condition="exists:portal/portlets.css"
               tal:content="string:@import url($portal_url/portlets.css);">
        </style>
        </tal:block>
    </metal:css>
    <style type="text/css" media="all" tal:condition="exists:context/local.css"
           tal:content="string:@import url(${context/local.css/absolute_url});">
    </style> 
Und das Stylesheet (DTML Method) sollte in etwa so aussehen:

Code: Alles auswählen

/* <dtml-with base_properties> (do not remove this :) */
/* <dtml-call "REQUEST.set('portal_url', portal_url())"> (not this either :) */

/* Logo properties */

#portal-logo {
    background: url(&dtml-portal_url;/&dtml-logoName2;) no-repeat;
    border: 0;
    margin: 0.75em 0em 0.75em 1.5em;
    padding: 0;
}

#portal-logo a {
    display: block;
    text-decoration: none;
    overflow: hidden;
    border: 0;
    margin: 0;
    padding: 0;
    padding-top: <dtml-var "_[logoName2].height">px;
    height: 0px !important;
    width: <dtml-var "_[logoName2].width">px;
    cursor: pointer;
}

/* </dtml-with> */
Dann sollte es funktionieren.

mfg
Gerold
:-)
http://halvar.at | Kleiner Bascom AVR Kurs
Wissen hat eine wunderbare Eigenschaft: Es verdoppelt sich, wenn man es teilt.
JR
User
Beiträge: 286
Registriert: Montag 20. Februar 2006, 16:43
Wohnort: Berlin

Hey Gerold!

Vielen Dank! Es funzt natürlich.
Ich hatte es zwar eben auf eine wesentlich unelegantere Methode gelöst, doch wer mag es schon umständlich?

Meine Lösung verlangte einen Eingriff ins main_template mit Durchsuchen der absolute_url und ein Anlegen einer lokalen global_logo-Vorlage im besagten Verzeichnis.

Deine Lösung ist denke ich so, wie man es machen sollte!

Vielen Dank nochmal!!

Grüße
Jamil
Antworten