André Rømcke <[email protected]> wrote on 27/07/2010 10:20:

2010/7/26 Gaetano Giunta <[email protected] <mailto:[email protected]>>

    André Rømcke <[email protected] <mailto:[email protected]>> wrote on 26/07/2010 10:51:


        Remember that sections only works on content, earlier ezp used session 
to remember it, but that caused issues if you had several tabs open to same 
install.
        So as of 4.4 it will not persist in session anymore, meaning non 
content related pages will not have override condition for sections.


    Interesting.

    How could then this requirement be satisfied in future versions?

    1. using separate siteaccesses - this would surely work, and is imho the 
cleanest solution, but it has some implications on the urls used to access the 
site
    and also on the development time (more time spent setting up configurations)

    2. adding a /(section)/green parameter to all links that point from content 
pages to non-content-related ones, then using that view parameter in the
    pagelayout to switch color.
    Pros: it whould work
    Cons: an awful lot of templates to be patched. Wiew parameters are 
available in pagelayout but not in view templates, so the value must be passed 
down the
    chain by hand if the design has to be switched within the view template 
too...

    3. variation on the above idea, but using a cookie instead, maybe via 
javascript (ie. set a 'section' cookie even when there's no session)
    Pros: easier to deploy than the fix-all-urls solution; does not make your 
urls ugly
    Cons: does not work well with bookmarks; does not work well with tabs

    4. adding some logic in the pagelayout that, when not showing a node, 
checks the referral url to see what section the user is coming from (eg. via a 
custom
    template op. in the pagelayout)
    Pros: you only need to alter the pagelayout template
    Cons: can slow down the site quite a bit; does not work well with bookmarks

    Ideas and comments are welcome.

    If a robust solution was found for setting multiple per-tab-values for a 
cookie, I think solution 3 could in fact be good enough to be incorporated into 
eZ...


Not sure what your referring to here, but my guess is admin2 use of cookies.
That is purely client side, and we wouldn't want to have a set-cookie statement 
on every request from server side as it would cause issues for reverse
proxies(not important for admin, but for front end).
The simplest solution seems to be siteaccess, put common settings in a 
extension (using ActiveAccessExtension) and use designs to serve different menu 
css /
template.

Definitely.

Just to clarify my proposal above:
. reverse proxies can (or not) store set-cookies headers along with the html 
page, so we cannot rely on them: correct
. but we could use js functions to set such a cookie, since (and as long as) it 
is not security-related
. the logic would thus become
  1. pagelayout tpl: add a few lines of js that, if the content/view view is 
being run (a node being viewed), set the section_id cookie to the browser
  3. pagelayout tpl: if not running content/view, and the section_id cookie is 
present, assume that section

All in all this can be wrapped up in 100% templates, so no need to alter the 
index.php or any kernel file.

The only scenario where it will not work is when a reverse proxy is in use, 
that will serve the same html page to users having two different session_id 
cookies.
This can be mitigated by having js code that reads that cookie and dynamically swaps the css in use, but it would be not enough to use a completely different template... which would bring us back to the 'use a different siteaccess' scenario :D


    bye
    Gaetano

        On Thu, Jul 15, 2010 at 2:34 PM, Carlos Revillo <[email protected] 
<mailto:[email protected]> <mailto:[email protected]
        <mailto:[email protected]>>> wrote:

            i would add two sections and will add override conditions for each 
one...

            2010/7/15 Kévin Surrault <[email protected] <mailto:[email protected]> 
<mailto:[email protected] <mailto:[email protected]>>>


                Hello !

                I am integrating a site which has two main parts. There are red 
pages
                and green pages that have only a few differences (background 
color and
                menus). There is a page that belongs to the two parts of the 
site, so
                it must have a red design and a green design, depending on the 
link
                that call it.

                My problem is : in the pagelayout template, how should I 
proceed to
                automatically set the appropriate design (red or green) to the 
page ?

                I've thought of fetching the node parent so I can know which 
part of
                the site is currently viewed, and then setting menus and divs 
like
                this (as in ezwebin templates) :

                {if eq($site_design, 'red')}
                    {include uri='design:page_redmenu.tpl'}
        <div id='red'>
                {else}
                    {include uri='design:page_greenmenu.tpl'}
        <div id='green'>
                {/if}

                ... </div>

                Is that a proper solution ? Do you have any better way to know 
the
                current part of the site, and to display the page in 
consequence ?

                Thank you !

                ___
                Kévin
                --
                Sdk-public mailing list
        [email protected] <mailto:[email protected]> 
<mailto:[email protected] <mailto:[email protected]>>

        http://lists.ez.no/mailman/listinfo/sdk-public



            --
            Sdk-public mailing list
        [email protected] <mailto:[email protected]> 
<mailto:[email protected] <mailto:[email protected]>>

        http://lists.ez.no/mailman/listinfo/sdk-public





<<attachment: gg.vcf>>

-- 
Sdk-public mailing list
[email protected]
http://lists.ez.no/mailman/listinfo/sdk-public

Reply via email to