I would like to create a dropdown login form in my menu, like in this example: http://bootsnipp.com/snippets/featured/fancy-navbar-login-sign-in-form
I have this cObject that calls typoscript for the navigation:
<f:cObject typoscriptObjectPath="menu.navbar" />
I need to get the content of the login form somehow into the menu typoscript. Is it maybe possible to pass a variable (in my case the login form) to typoscript via cObject ?
f:cObject
has adata
Attribute, that can take different kind of values.Usually the data attribute takes an array and you then can use those values to render content objects using the
.field
properties in typoscript.An example:
If you have TypoScript like that, a data array, that has the keys
title
andcontent
is expected. Rendering such a content object would possibly look like this in fluid:However, if you just have some "content" (e.g. string content) and want to output it at one place in your content object, you can pass it in as-is and use the
.current
property in TypoScript to let it use the "current value".And in fluid:
or
Of course data also takes normal variables. Depending on your use case, one of those cases might be what you want.
Edit: However, it seems to be a bit more complicated, if you want to use data together with an HMENU. The nested TMENU instances (or other menus) have different data values because it's being overwritten by HMENU with the current page for that menu entry. You probably have to do some convoluted wrapping, or avoid inserting the desired content in a TMENU/GMENU et cetera. I suggest to instead render the menu completely with fluid in that case.
Edit 2 - Example
Something like this is not going to work:
20.current = 1
won't include the value from data supplied by the fluid viewhelper, because the "data" of TMENU has been changed to the current page by the HMENU content object.However, it should be possible to wrap a COA or similar around the HMENU to insert the desired content somewhere around the HMENU.