如何创建一个菜单,自动将所涉及的页面命名为数字导航?
这将是我的页面树:
新闻
| --- Newsarticle tom(包含9个内容元素)
| --- Skeet的东西(包含9个内容元素)
| --- Jessicas 5篇文章(包含4个内容元素)
在前面所有3页将简单地显示为数字navi :(
想象这里的"Newsarticle tom"的9个textpic元素)
1 - 2 - 3
我创建了一个TYPO3插件,用于向tt_content添加新的内容列.
我需要后端的预览页面的页眉和页脚内容.一旦我得到页眉和页脚,我可以在这之间显示我的内容.我想在内容区域中插入一些编辑功能.这就是为什么我需要将html渲染输出到php变量.
我正在使用templavoila.
我试过这个 - 但是收到了一个错误:
$this->cObj = t3lib_div::makeInstance('tslib_cObj');
$conf = array('userFunc' => 'tx_templavoila_pi1->main_page');
$content = $this->cObj->USER($conf);
Run Code Online (Sandbox Code Playgroud)
#1316104317:无法确定扩展名"myplugin"和插件"ContentRenderer"的默认控制器.请检查ext_localconf.php中的TYPO3\CMS\Extbase\Utility\ExtensionUtility :: configurePlugin().
我们可以在include_typoscript中使用常量变量吗?
在我的constants.txt文件中
filepaths{
# cat=FLUIDPAGES/settings; type=text; label=Pfad zu den Templates
defaultTemplateRootPath = typo3conf/ext/defaulttemplate/
}
Run Code Online (Sandbox Code Playgroud)
在我的setup.txt文件中
Include Page Template
<INCLUDE_TYPOSCRIPT: source="FILE: {$filepaths.defaultTemplateRootPath}fluid.txt">
Run Code Online (Sandbox Code Playgroud)
我只需要在我的安装文件中使用{$ filepaths.defaultTemplateRootPath}来包含typoscript文件,如果是,它对我很有用,我可以在多域网站中添加多个主题/模板.
使用Typo3构建菜单需要帮助.目前我在TS中构建我的菜单:
TopNavigation = HMENU
TopNavigation {
special = directory
special.value = 3
entryLevel = 1
1 = TMENU
1.expAll = 1
1.NO = 1
1.NO.wrapItemAndSub = <li class="parent"> | </li>
2 < .1
2.expAll = 0
2.NO = 1
2.NO.ATagBeforeWrap = 1
2.NO.wrapItemAndSub = <li> | </li>
2.wrap = <ul class="dropdown"> | </ul>
}
Run Code Online (Sandbox Code Playgroud)
但是像这样,Typo3使用页面树来创建导航.现在我想从页面本身添加锚点到我的导航.我发现这样做的TS看起来像这样:
AnchorNavigation = CONTENT
AnchorNavigation {
table = tt_content
select {
pidInList = this
orderBy = sorting
where = colPos=0 AND sectionIndex=1
languageField=sys_language_uid
}
wrap = …Run Code Online (Sandbox Code Playgroud) 如果我想在 Fluid 模板中使用 TypoScript 之类的菜单生成,我有两种可能的方法:
使用 TypoScript 填充模板的变量。这样做:
page.10 = FLUIDTEMPLATE
page.10 {
templateName = index.html
// ... define pathes ...
variables {
contentMain < styles.content.get
mainMenu < temp.mainMenu
:
}
}
Run Code Online (Sandbox Code Playgroud)
在模板中只使用变量:
<div class="header">
<div class="logo">{logo->f:format.raw()}</div>
<div class="main-menu">{mainMenu->f:format.raw()}</div>
</div>
Run Code Online (Sandbox Code Playgroud)另一种方式是使用 f:cObject ViewHelper 来调用 TypoScript 的一部分。
打字稿:
page.10 = FLUIDTEMPLATE
page.10 {
templateName = index.html
// ... define pathes ...
variables {
contentMain < styles.content.get
:
}
}
lib.mainMenu < temp.mainMenu
Run Code Online (Sandbox Code Playgroud)
而 Fluid 模板如下所示:
<div class="header">
<div class="logo">{logo->f:format.raw()}</div>
<div class="main-menu"> …Run Code Online (Sandbox Code Playgroud)我正在构建带有后端模块的扩展。当我调用findAll () 方法时,它返回一个“QueryResult”对象。
我尝试使用findByUid () 检索对象,它确实有效。
我在打字稿中设置了存储pid:
plugin.tx_hwforms.persistence.storagePid = 112
Run Code Online (Sandbox Code Playgroud)
我还可以在打字稿对象浏览器中看到它。
我还将其添加到我的存储库类中:
public function initializeObject()
{
$defaultQuerySettings = $this->objectManager->get(\TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings::class);
$defaultQuerySettings->setRespectStoragePage(false);
$this->setDefaultQuerySettings($defaultQuerySettings);
}
Run Code Online (Sandbox Code Playgroud)
这样存储 pid 就被忽略了...它仍然不起作用,findAll 没有返回应有的实体数组
我写了一个扩展,并通过后端实现插件完成所有事情.
但是当我尝试通过typoscript实现我的扩展时,我每次都会收到此错误:
糟糕,发生错误!
无法确定默认控制器.请检查ext_localconf.php中的Tx_Extbase_Utility_Extension :: configurePlugin().
我不知道为什么..我尝试了不同的实现(根据tx_extbase_core_bootstrap-> run或tx_extbase_dispatcher-> dispatch以及附加信息而没有),当前的typoscript如下所示:
plugin.tx_graphichmenu {
settings {
menuUid = 1
}
}
lib.tx_graphichmenu = USER
lib.tx_graphichmenu {
userFunc = tx_extbase_core_bootstrap->run
extensionName = Graphichmenu
pluginName = Graphicmenu
controller = MenuController
action = showAction
}
temp.mainTemplate.subparts.stickyfooter < lib.tx_graphichmenu
Run Code Online (Sandbox Code Playgroud)
我双精度和三重检查一切,我发现没有一个单一的错......试过了没有"行动"和"调节器"的一部分,并没有什么改变
我在ext_localconf.php中的configurePlugin部分如下所示:
Tx_Extbase_Utility_Extension::configurePlugin(
$_EXTKEY,
'Graphicmenu',
array(
'Menu' => 'show',
),
// non-cacheable actions
array(
'Menu' => '',
)
);
Run Code Online (Sandbox Code Playgroud)
"show"动作没有参数.在那里我加载ts设置从我拿到对象的Uid显示
PS:每次更改后我都清除了缓存并删除了typo3conf中的"temp_CACHED _..."文件
我使用此配置来遵循 HTML5boilerplate。
config{
doctype = html_5
doctype(
<!doctype html>
<!--[if lt IE 7 ]> <html lang="de" class="no-js ie6"> <![endif]-->
<!--[if IE 7 ]> <html lang="de" class="no-js ie7"> <![endif]-->
<!--[if IE 8 ]> <html lang="de" class="no-js ie8"> <![endif]-->
<!--[if IE 9 ]> <html lang="de" class="no-js ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!-->
)
htmlTag_setParams = lang="de" class="no-js no-ie"><!--<![endif]--
}
Run Code Online (Sandbox Code Playgroud)
问题是,当我有一个包含多种替代语言的站点时,该lang属性不会更新。
有谁知道如何解决这个问题?
有没有办法通过php从子页面获取所有父ID?
...
Page
Page 12
Subpage 21
Subpage 22
CurrentPage 23
Run Code Online (Sandbox Code Playgroud)
想得到12,21
我有一个带有以下代码的 flexform:
<image>
<TCEforms>
<label>LLL:EXT:my_slider/Resources/Private/Language/locallang.xlf:flexform.slider.main.slider.image</label>
<config>
<type>group</type>
<internal_type>file</internal_type>
<allowed>jpg, jpeg, gif, png</allowed>
<show_thumbs>1</show_thumbs>
<minitems>0</minitems>
<maxitems>1</maxitems>
<size>1</size>
</config>
</TCEforms>
</image>
Run Code Online (Sandbox Code Playgroud)
直到现在这有效。但现在在 TYPO3 10 中,我收到此错误:
表 tt_content 中字段“image”的 TCA internal_type 必须设置为“db”或“folder”。
我该如何解决这个问题?如何将我的 flexform 迁移到 FAL?我已经测试了一些解决方案,但它们以:
字段名称“pi_flexform”上的无效 flex 表单数据结构在部分容器“sliderConfiguration”中具有元素“image”:不允许在 flex 表单部分中嵌套内联元素。
如果我写
<el>
<settings.slider type="array">
<title>LLL:EXT:my_slider/Resources/Private/Language/locallang.xlf:flexform.slider.main.slider</title>
<type>array</type>
<section>1</section>
<el>
<sliderConfiguration>
<type>array</type>
<title>LLL:EXT:my_slider/Resources/Private/Language/locallang.xlf:flexform.slider.main.slider.slide</title>
<el>
<media>
<!-- /sf/ask/3328797041/ -->
<TCEforms>
<label>
LLL:EXT:va_template/Resources/Private/Language/locallang.xlf:content_element.backgroundtext.settings.image
</label>
<config>
<type>inline</type>
<minitems>1</minitems>
<maxitems>1</maxitems>
<appearance type="array">
<enabledControls type="array">
<delete>1</delete>
<dragdrop>1</dragdrop>
<new>0</new>
<hide>1</hide>
<info>1</info>
</enabledControls>
<fileUploadAllowed>1</fileUploadAllowed>
<headerThumbnail type="array">
<field>uid_local</field>
<height>100c</height>
<width>100</width>
</headerThumbnail>
<useSortable>1</useSortable> …Run Code Online (Sandbox Code Playgroud) typo3 ×10
typoscript ×10
extbase ×2
fluid ×2
menu ×2
anchor ×1
fal ×1
flexform ×1
navigation ×1
php ×1
plugins ×1
templavoila ×1
typo3-10.x ×1