Global navigation across different layouts

8 views
Skip to first unread message

Sergejs Smirnovs

unread,
Aug 7, 2010, 5:51:50 AM8/7/10
to diem-users
Situation:
I have 5 different layouts, with absolutly different HTML(cannot use
one layout).
Using tools->layouts there are same Areas for Navigation
widget(superios widget with drag&drop).

Problem:
In case of creating new page - i need to configure this widget. Is
there any solution to have widget same configuration across all
layouts ?


PS I have this problem in all my DM sites.


Thanks a lot!

Sergejs Smirnovs

unread,
Aug 26, 2010, 3:44:09 PM8/26/10
to diem-users
There is no solution on this trable ? :(

On Aug 7, 12:51 pm, Sergejs Smirnovs <sergejs.smirn...@gmail.com>
wrote:

Evgeny Sinitsyn

unread,
Aug 26, 2010, 10:26:26 PM8/26/10
to diem-...@googlegroups.com
It seems to be so

2010/8/27 Sergejs Smirnovs <sergejs....@gmail.com>

Robert

unread,
Aug 27, 2010, 4:15:32 AM8/27/10
to diem-users
Oh, I have the same problem. That is really annoying. The header &
footer section is the same for my layout, but I have to create it
twice, which sucks as you said. I hope there will be a solution in
future.

On Aug 27, 4:26 am, Evgeny Sinitsyn <cuh...@gmail.com> wrote:
> It seems to be so
>
> 2010/8/27 Sergejs Smirnovs <sergejs.smirn...@gmail.com>

h16bit

unread,
Sep 23, 2010, 7:19:18 AM9/23/10
to diem-users
There is solution
http://gist.github.com/587674

Sergejs Smirnovs

unread,
Sep 23, 2010, 3:40:27 PM9/23/10
to diem-users
Что этот снипет будет делать? :) сделает все зоны сквозными для всех
шаблонов? и как он работает ?

How this snippet is working? Making all zones global for all layouts ?

On Sep 23, 2:19 pm, h16bit <h16...@gmail.com> wrote:
> There is solutionhttp://gist.github.com/587674

Sergejs Smirnovs

unread,
Sep 23, 2010, 3:43:05 PM9/23/10
to diem-users
Just reviewed diff - there is some kind of area_id - how to pass it in
layout ? :)

On Sep 23, 10:40 pm, Sergejs Smirnovs <sergejs.smirn...@gmail.com>

h16bit

unread,
Sep 24, 2010, 1:59:27 AM9/24/10
to diem-users
Its diff add third parameter in renderArea method, this parameter it
is id of layout, where are the global area from.
Example - you have layout of general page and in this layout you have
header area. You need place current area in all templates - usual task
for site developer. In layout of another page you just need to set
third parameter in renderArea - id of general page layout, like
renderArea('layout.header',null,1), where 1 - is id of general page
layout.
Nou you dont need to setup all standart elements(like menu) in every
layout.

Патч добавляет третий параметр в renderArea, указывающий на айдишник
шаблона из которого нужно выдернуть соответствующую зону.
Например: есть шаблон главной страницы, в нем разместили зону в
которую конструктором поместили лого, меню и тп - стандартная задача
для разработчика.
В шаблоне остальных страниц просто пишем
renderArea('layout.header',null,1) - где 1 - айдишник шаблона главной
страницы. Теперь нет нужды настраивать например меню в каждом шаблоне
отдельно.

h16bit

unread,
Sep 24, 2010, 2:03:55 AM9/24/10
to diem-users
And one more - its parametr is optional for any zone, its mean thats
he set global only for zones with third parameter.

Кстати этот параметр опционален для каждой зоны, тоесть он делает
глобальной только нужную зону.

Sergejs Smirnovs

unread,
Sep 24, 2010, 5:03:24 AM9/24/10
to diem-users
супер! )

realy nice! :)

Sergejs Smirnovs

unread,
Sep 27, 2010, 4:28:08 PM9/27/10
to diem-users
Cannot understand how to apply this pach..

что-то я туплю - как прихерачить этот патч к диему ? :)

On Sep 24, 9:03 am, h16bit <h16...@gmail.com> wrote:

h16bit

unread,
Sep 28, 2010, 11:56:03 AM9/28/10
to diem-users
Apply patch for file ./lib/vendor/diem/dmFrontPlugin/lib/view/html/
page/dmFrontPageBaseHelperMy.php with special program, if you dont
know how, you can do it by hands, just edit this file and remove all
strings with '-' symbol and add all strings with '+' symbol, strings
without them dont touch - they just for marking where you must edit.
Now you must add third parameter in renderArea function in template
file, like renderArea('layout.header',null,1) where 1 - its the id of
layout,where are placed global area.

Important: you must know difference between area and zone - area is
the place, where we placing the zone and other elements in front
administrator interface!

Example:
You have two layouts like "General"(id = 1) and "Usual". Id of
template you can see in administration panel in layouts page(if you
hover on the name of layout, you can find id in link). In general
layout you have header with menu, logo and other elements, you need to
place this header into usual template,so...

In layout file of "Usual template" - usualSuccess.php you must edit
renderArea like this:
renderArea('layout.header',null,1)
Refresh cache and now you have general page header in you usual
template.And you can edit elements in this area in all templates,
changes will showing in all of them.

Наложить патч на файл ./lib/vendor/diem/dmFrontPlugin/lib/view/html/
page/dmFrontPageBaseHelperMy.php можно с помозью специальнйо
программой, или вручную:
все строки со знаком - нужно удалить, а со знаком + добавить, строки
без знаков не нужно трогать, они лишь помогают соориентироваться где
делать измнения.
Теперь можно добавлять третий параметр в фуфнкцию renderArea, например
renderArea('layout.header',null,1) где 1 - айдишник шаблона из
которого мы хотим достать соответствующую область.

Важно отличать область и зону - область это место в шаблоне, куда мы
кидаем все элементы включая зону в админке.

Пример:

У нас есть два шаблона "Главная" с айдишником 1 и "Обычная", нам надо
поместить шапку из главного шаблона с логотипом, меню и прочим в
обычный...

Редактируем в файле обычного шаблона usualSuccess.php функцию
renderArea так:
renderArea('layout.header',null,1)
Обновляем кеш и вуаля - шапка из главного шаблона теперь и в обычном,
причем так, что можно редактировать все элементы в этой области, а
изменения будут отображаться во всех соответствующих шаблонах.

Sergejs Smirnovs

unread,
Sep 28, 2010, 12:50:31 PM9/28/10
to diem-users
У меня вопрос имено про программу, как из под консоли сделать
merge ? :)

Witch program are you using ?

h16bit

unread,
Sep 29, 2010, 4:46:36 AM9/29/10
to diem-users
patch < file.diff
where file.diff - name of patch file

h16bit

unread,
Oct 1, 2010, 4:03:15 AM10/1/10
to diem-users
Ok, now i understand how github working, so you can update all my
three patches by git.
http://github.com/h16bit/diem

On 28 сен, 02:28, Sergejs Smirnovs <sergejs.smirn...@gmail.com> wrote:

Reply all
Reply to author
Forward
0 new messages