Russian TYPO3 community Форум больше не используется. Присоединяйтесь к каналу #community-ru в Slack for TYPO3 community  

Вернуться   Russian TYPO3 community > Тематические форумы > TypoScript практикум

Ответ
 
Опции темы Опции просмотра
Старый 24.09.2006, 14:27   #1
ahold
Новенький
 
Регистрация: 23.09.2006
Сообщений: 2
По умолчанию foldoutmenu нужна помощь

Доброго времени суток всем.

Собственно только начал разбиратся с системой.
Создал свой шаблон опираясь на руководство (Futuristic Template Building),
все работает
Мне тепрь нужно создать меню (treemenu) взял пример из (foldoutmenu)
вставил в Constants:
Код:
lib.treemenu {
  imgFolder = typo3conf/ext/foldoutmenu/examples/treemenu/menu/win/
  splitImg = join.gif
  vertlineImg = line.gif
  cornerImg = joinbottom.gif
  collapseImg = plus.gif
  collapse_cornerImg = plusbottom.gif
  collapse_corner_firstImg = plusonly.gif
  collapse_firstImg = plustop.gif
  expandImg = minus.gif
  expand_cornerImg = minusbottom.gif
  expand_corner_firstImg = minusonly.gif
  expand_firstImg = minustop.gif
  spaceImg = blank.gif
  folder_openImg = folderopen.gif
  folder_closedImg = folderclosed.gif
  itemImg =  menu_link_no.gif
  itemImgActive = menu_link_cur.gif
  menuRoot = folderopen.gif
}
в setup у меня сейчас:
Код:
includeLibs.foldoutmenu = typo3conf/ext/foldoutmenu/foldoutmenu.php

lib.treemenu = COA
lib.treemenu {
  10 = HMENU
  10.wrap = <div id="menu"><ul>|</ul></div>
  10.entryLevel = 1
  10.1 = TMENU
  10.1 {
    expAll = 1
    itemArrayProcFunc = user_foldoutMenu->getIfSubUidList
    NO {
      before.cObject = COA
      before.cObject {
        10 = IMAGE
        10.file = {$lib.treemenu.imgFolder}{$lib.treemenu.splitImg} |*||*| {$lib.treemenu.imgFolder}{$lib.treemenu.cornerImg}
        10.params = align="top"

        20 = IMAGE
        20.file = {$lib.treemenu.imgFolder}{$lib.treemenu.itemImg}
        20.altText = »»
        20.titleText = »»
        20.params = align="top"
      }
      ATagParams = class="no"
      allWrap = <li>|</li>
    }
    CUR < .NO
    CUR = 1
    CUR.before.cObject.20.file = {$lib.treemenu.imgFolder}{$lib.treemenu.itemImgActive}
    CUR.ATagParams = class="act"
    IFSUB < .NO
    IFSUB = 1
    IFSUB {
      subst_elementUid = 1
      before.cObject = COA
      before.cObject {
        10.file = {$lib.treemenu.imgFolder}{$lib.treemenu.collapseImg} |*||*| {$lib.treemenu.imgFolder}{$lib.treemenu.collapse_cornerImg}
        10.wrap = <A onmousedown="fmenu.foldMenu('fmenu-{elementUid}');return false;" style="cursor: pointer;cursor: hand;">|
        10.altText = -
        10.titleText = -
        10.params = align="top" id="fmenu-{elementUid}-1" |*||*| align="top" id="fmenu-{elementUid}-2"

        20.file = {$lib.treemenu.imgFolder}{$lib.treemenu.folder_closedImg}
        20.wrap = |</A>
        20.altText = Click to open
        20.titleText = Click to open
        20.params = align="top" id="fmenu-{elementUid}-0"

        40 = LOAD_REGISTER
        40.level2tree = {$lib.treemenu.vertlineImg} |*||*| {$lib.treemenu.spaceImg}
      }
      allWrap = <li>|<ul id="fmenu-{elementUid}">
      wrapItemAndSub = |</ul></li>
    }
    ACTIFSUB < .IFSUB
    ACTIFSUB = 1
    ACTIFSUB.before.cObject.10.file = {$lib.treemenu.imgFolder}{$lib.treemenu.expandImg} |*||*| {$lib.treemenu.imgFolder}{$lib.treemenu.expand_cornerImg}
    ACTIFSUB.before.cObject.10.altText = +
    ACTIFSUB.before.cObject.10.titleText = +
    ACTIFSUB.before.cObject.10.params = align="top" id="fmenu-{elementUid}-1" |*||*| align="top" id="fmenu-{elementUid}-2"
    ACTIFSUB.before.cObject.20.file = {$lib.treemenu.imgFolder}{$lib.treemenu.folder_openImg}
    ACTIFSUB.before.cObject.20.altText = Click to close
    ACTIFSUB.before.cObject.20.titleText = Click to close
    ACTIFSUB.before.cObject.20.params = align="top" id="fmenu-{elementUid}-0"
    ACTIFSUB.allWrap = <li>|<ul id="fmenu-{elementUid}" style="display:block;">
    CURIFSUB < .IFSUB
    CURIFSUB = 1
    CURIFSUB.ATagParams = class="act"
  }
  10.2 < .10.1
  10.2 {
    NO.before.cObject {
      1 = IMAGE
      1.file.import = {$lib.treemenu.imgFolder}
      1.file.import.data = register:level2tree
      1.file.import.listNum = 0
      1.params = align="top"
    }
    CUR.before.cObject.1 < .NO.before.cObject.1
    IFSUB.before.cObject.1 < .NO.before.cObject.1
    IFSUB.before.cObject.40.level2tree >
    IFSUB.before.cObject.40.level3tree = {$lib.treemenu.vertlineImg} |*||*| {$lib.treemenu.spaceImg}
    ACTIFSUB < .IFSUB
    ACTIFSUB = 1
    ACTIFSUB.before.cObject.10.file = {$lib.treemenu.imgFolder}{$lib.treemenu.expandImg} |*||*| {$lib.treemenu.imgFolder}{$lib.treemenu.expand_cornerImg}
    ACTIFSUB.before.cObject.10.altText = +
    ACTIFSUB.before.cObject.10.titleText = +
    ACTIFSUB.before.cObject.10.params = align="top" id="fmenu-{elementUid}-1" |*||*| align="top" alt="+" title="+" id="fmenu-{elementUid}-2"
    ACTIFSUB.before.cObject.20.file = {$lib.treemenu.imgFolder}{$lib.treemenu.folder_openImg}
    ACTIFSUB.before.cObject.20.altText = Click to close
    ACTIFSUB.before.cObject.20.titleText = Click to close
    ACTIFSUB.before.cObject.20.params = align="top" id="fmenu-{elementUid}-0"
    ACTIFSUB.allWrap = <li>|<ul id="fmenu-{elementUid}" style="display:block;">
    CURIFSUB < .IFSUB
    CURIFSUB.ATagParams = class="act"
  }
  10.3 < .10.2
  10.3 {
    NO.before.cObject {
      2 = IMAGE
      2.file.import = {$lib.treemenu.imgFolder}
      2.file.import.data = register:level3tree
      2.file.import.listNum = 0
      2.params = align="top"
    }
    CUR.before.cObject.2 < .NO.before.cObject.2
    IFSUB.before.cObject.2 < .NO.before.cObject.2
    IFSUB.before.cObject.40.level3tree >
    IFSUB.before.cObject.40.level4tree = {$lib.treemenu.vertlineImg} |*||*| {$lib.treemenu.spaceImg}
    ACTIFSUB < .IFSUB
    ACTIFSUB = 1
    ACTIFSUB.before.cObject.10.file = {$lib.treemenu.imgFolder}{$lib.treemenu.expandImg} |*||*| {$lib.treemenu.imgFolder}{$lib.treemenu.expand_cornerImg}
    ACTIFSUB.before.cObject.10.altText = +
    ACTIFSUB.before.cObject.10.titleText = +
    ACTIFSUB.before.cObject.10.params = align="top" id="fmenu-{elementUid}-1" |*||*| align="top" alt="+" title="+" id="fmenu-{elementUid}-2"
    ACTIFSUB.before.cObject.20.file = {$lib.treemenu.imgFolder}{$lib.treemenu.folder_openImg}
    ACTIFSUB.before.cObject.20.altText = Click to close
    ACTIFSUB.before.cObject.20.titleText = Click to close
    ACTIFSUB.before.cObject.20.params = align="top" id="fmenu-{elementUid}-0"
    ACTIFSUB.allWrap = <li>|<ul id="fmenu-{elementUid}" style="display:block;">
    CURIFSUB < .IFSUB
    CURIFSUB.ATagParams = class="act"
  }
  10.4 < .10.3
  10.4 {
    NO.before.cObject {
      3 = IMAGE
      3.file.import = {$lib.treemenu.imgFolder}
      3.file.import.data = register:level4tree
      3.file.import.listNum = 0
      3.params = align="top"
    }
    CUR.before.cObject.3 < .NO.before.cObject.3
    IFSUB.before.cObject.3 < .NO.before.cObject.3

    IFSUB.before.cObject.40.level4tree >
    IFSUB.before.cObject.40.level5tree = {$lib.treemenu.vertlineImg} |*||*| {$lib.treemenu.spaceImg}
    ACTIFSUB < .IFSUB
    ACTIFSUB = 1
    ACTIFSUB.before.cObject.10.file = {$lib.treemenu.imgFolder}{$lib.treemenu.expandImg} |*||*| {$lib.treemenu.imgFolder}{$lib.treemenu.expand_cornerImg}
    ACTIFSUB.before.cObject.10.altText = +
    ACTIFSUB.before.cObject.10.titleText = +
    ACTIFSUB.before.cObject.10.params = align="top" id="fmenu-{elementUid}-1" |*||*| align="top" alt="+" title="+" id="fmenu-{elementUid}-2"
    ACTIFSUB.before.cObject.20.file = {$lib.treemenu.imgFolder}{$lib.treemenu.folder_openImg}
    ACTIFSUB.before.cObject.20.altText = Click to close
    ACTIFSUB.before.cObject.20.titleText = Click to close
    ACTIFSUB.before.cObject.20.params = align="top" id="fmenu-{elementUid}-0"
    ACTIFSUB.allWrap = <li>|<ul id="fmenu-{elementUid}" style="display:block;">
    CURIFSUB < .IFSUB
    CURIFSUB.ATagParams = class="act"
  }
  10.5 < .10.4
  10.5 {
    NO.before.cObject {
      4 = IMAGE
      4.file.import = {$lib.treemenu.imgFolder}
      4.file.import.data = register:level5tree
      4.file.import.listNum = 0
      4.params = align="top"
    }
    CUR.before.cObject.4 < .NO.before.cObject.4
    IFSUB.before.cObject.4 < .NO.before.cObject.4
    IFSUB.before.cObject.40.level5tree >
    IFSUB.before.cObject.40.level6tree = {$lib.treemenu.vertlineImg} |*||*| {$lib.treemenu.spaceImg}
    ACTIFSUB < .IFSUB
    ACTIFSUB = 1
    ACTIFSUB.before.cObject.10.file = {$lib.treemenu.imgFolder}{$lib.treemenu.expandImg} |*||*| {$lib.treemenu.imgFolder}{$lib.treemenu.expand_cornerImg}
    ACTIFSUB.before.cObject.10.altText = +
    ACTIFSUB.before.cObject.10.titleText = +
    ACTIFSUB.before.cObject.10.params = align="top" id="fmenu-{elementUid}-1" |*||*| align="top" alt="+" title="+" id="fmenu-{elementUid}-2"
    ACTIFSUB.before.cObject.20.file = {$lib.treemenu.imgFolder}{$lib.treemenu.folder_openImg}
    ACTIFSUB.before.cObject.20.altText = Click to close
    ACTIFSUB.before.cObject.20.titleText = Click to close
    ACTIFSUB.before.cObject.20.params = align="top" id="fmenu-{elementUid}-0"
    ACTIFSUB.allWrap = <li>|<ul id="fmenu-{elementUid}" style="display:block;">
    CURIFSUB < .IFSUB
    CURIFSUB.ATagParams = class="act"
  }

  20 = TEXT
  20.data = register:ifSubUidList
  20.postUserFunc = user_foldoutMenu->JSWrapper
  20.postUserFunc.prefix = fmenu
  20.postUserFunc.startFolded = 1
  20.postUserFunc.enableCookie = 1
  20.postUserFunc.imagePath = {$lib.treemenu.imgFolder}
  20.postUserFunc.imageSwap (
		["{$lib.treemenu.folder_closedImg}","{$lib.treemenu.folder_openImg}"],
		["{$lib.treemenu.collapseImg}","{$lib.treemenu.expandImg}"],
		["{$lib.treemenu.collapse_cornerImg}","{$lib.treemenu.expand_cornerImg}"],
		["{$lib.treemenu.collapse_corner_firstImg}","{$lib.treemenu.expand_corner_firstImg}"],
		["{$lib.treemenu.collapse_firstImg}","{$lib.treemenu.expand_firstImg}"]
  )
  20.postUserFunc.altSwap (
		["Click to open","Click to close"],
		["+","-"],
		["+","-"],
		["+","-"],
		["+","-"]
  )
  20.required = 1
}
... продолжение ниже
ahold вне форума   Ответить с цитированием
Старый 24.09.2006, 14:28   #2
ahold
Новенький
 
Регистрация: 23.09.2006
Сообщений: 2
По умолчанию

Код:
page = PAGE
page.typeNum = 0
page.10 = USER
page.10.userFunc = tx_templavoila_pi1->main_page


page.CSS_inlineStyle (
	#menu {width: 200px;font: normal normal normal 11px/13px Arial, Helvetica, sans-serif;}
	#menu ul {list-style: none;margin: 0px;padding: 0px;}
	#menu ul ul {display:none;}
	#menu ul li {list-style: none;margin: 0px;padding: 0px;}
	#menu A.no, #menu A.act {color: #000000;text-decoration: none;}
	#menu A.no:hover, #menu A.act:hover { text-decoration : underline;}
	#menu A.act, #menu A.act:hover { font-weight : bold;}
	#menu UL, #menu LI {margin: 0px;padding: 0px;list-style: none;}
)
и в xml DS:
Код:
<T3DataStructure>
    <ROOT type="array">
        <tx_templavoila type="array">
            <title>ROOT</title>
            <description>Select the HTML element on the page which you want to be the overall container element for the template.</description>
            <tags>body</tags>
        </tx_templavoila>
        <type>array</type>
        <el type="array">
            <field_content type="array">
                <tx_templavoila type="array">
                    <title>Main Content Area</title>
                    <description>Pick the HTML element in the template where you want to place the main content of the site.</description>
                    <sample_data type="array">
                        <numIndex index="0">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Pellentesque porta erat vitae nisl. In hac habitasse platea dictumst. Aliquam ac urna. Morbi magna mauris, semper ut, varius in, convallis vitae, nulla. Proin massa lorem, mollis eget, rutrum vitae, commodo id, risus. Curabitur scelerisque risus eget odio. Proin laoreet blandit elit. Aenean varius, sapien laoreet dapibus volutpat, risus lorem ornare wisi, lobortis venenatis nisl augue sed purus. Nam suscipit viverra justo. Suspendisse tincidunt. Nullam vel quam.</numIndex>
                    </sample_data>
                    <eType>ce</eType>
                    <tags>table:outer,td:inner,div:inner,p,h1,h2,h3,h4,h5</tags>
                    <TypoScript>
	10= RECORDS
	10.source.current=1
	10.tables = tt_content
							</TypoScript>
                </tx_templavoila>
                <TCEforms type="array">
                    <config type="array">
                        <type>group</type>
                        <internal_type>db</internal_type>
                        <allowed>tt_content</allowed>
                        <size>5</size>
                        <maxitems>200</maxitems>
                        <minitems>0</minitems>
                        <multiple>1</multiple>
                        <show_thumbs>1</show_thumbs>
                    </config>
                    <label>Main Content Area</label>
                </TCEforms>
            </field_content>
            <field_menu type="array">
                <tx_templavoila type="array">
                    <title>Main menu</title>
                    <description>Pick the HTML container element where you want the automatically made menu items to be placed.</description>
                    <sample_data type="array">
                        <numIndex index="0">[Menu goes here]</numIndex>
                    </sample_data>
                    <eType>TypoScriptObject</eType>
                    <tags>table:inner,div,tr,td</tags>
                    <eType_EXTRA type="array">
                        <objPath>lib.treemenu</objPath>
                    </eType_EXTRA>
                    <TypoScriptObjPath>lib.treemenu</TypoScriptObjPath>
                </tx_templavoila>
            </field_menu>
        </el>
    </ROOT>
</T3DataStructure>
Работать не хочет пока сам разобратся немогу почему, хотя другой пример из (foldoutmenu) работает:
Код:
lib.simplemenu = COA
lib.simplemenu {
  10 = HMENU
  10.wrap = <ul>|</ul>
  10.1 = TMENU
  10.1 {
    expAll = 1
    itemArrayProcFunc = user_foldoutMenu->getIfSubUidList
    NO {
      allWrap = <li>|</li>
    }
    IFSUB < .NO
    IFSUB = 1
    IFSUB {
      subst_elementUid = 1
      doNotLinkIt = 1
      linkWrap = <A onmousedown="amenu.foldMenu('amenu-{elementUid}');return false;" style="cursor: pointer;">|</A>
      allWrap = <li>|<ul id="amenu-{elementUid}">
      wrapItemAndSub = |</ul></li>
    }
  }
  10.2 < .10.1
  10.3 < .10.1
  10.4 < .10.1

  20 = TEXT
  20.data = register:ifSubUidList
  20.postUserFunc = user_foldoutMenu->JSWrapper
  20.postUserFunc.prefix = amenu
  20.required = 1
}

page.10 < lib.simplemenu
Если у кого есть возможность подскажите новичку в чем я не прав

Последний раз редактировалось ahold; 24.09.2006 в 14:30
ahold вне форума   Ответить с цитированием
Ответ


Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB code is Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.

Быстрый переход


Часовой пояс GMT +4, время: 23:59.


Работает на vBulletin® версия 3.8.1.
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Перевод: zCarot

Хостинг и техническая поддержка: TYPO3 Лаборатория