Give a class to specific Page in Main Menu in Typo3 - typo3

I want to achieve having a menu with 2 levels, and some should always be expanded - some shouldn't. Is there any way I can hand over a class or something, if possible set up in the backend, to be able to choose which menu links should be expanded?
For example:
Menu Link 1 with no subitems
Menu Link 2 with subitems expandable (sublinks only visible on click)
Menu Link 3 with subitems always expanded (sublinks always visible)
Sub link 1
Sub link 2

In general you need to add a class to the link or the litag so CSS or javascript can decide which parts are visible.
A similar question would be to have some submenus not rendered at all, but as you want these submenus to be visible on a click they must be rendered anyway. so it is only the question how to get this information into the rendered menu. it should be a flag which can change the visibility. that could be done with CSS and javascript.
You can sore this information in the pagesrecord, where you can use any otherwise unused field (example would be layout). The realisation depends on the way you generate the menu.
Meanwhile you have two options:
classic: with typoscript
fluid: menu-processor
With both options you can add classes to the menu-items, where the JS can work on.

Related

TYPO3 Add Copy and Paste icons to Content Elements

Is it possible to add icons to the left or right side for Content Elements? I would like to move some of the functionality from the contextMenu to the icon bar, is that possible? Perhaps by TSConfig ? See attachment.
Several options exist for multiple TYPO3 versions and depending on where you would prefer to add the copy/cut icon, or indeed, any other icon you might wish:
Before 10.3 and without fluid-based page layout module:
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['recStatInfoHooks']
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php']['tt_content_drawFooter']
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php']['tt_content_drawItem'] through $outHeader variable.
After 10.3 with fluid-based page layout module:
All of the above, plus
Overlay of template EXT:backend/Resources/Private/Partials/PageLayout/Record/Header.html, or
Overlay of template EXT:backend/Resources/Private/Partials/PageLayout/Record/Footer.html, or
Overlay of template EXT:backend/Resources/Private/Partials/PageLayout/Record.html depending on where you want the icon to be placed
These should provide you with every conceivable option for adding the icon precisely where you wish it to be added. TYPO3 10.3 with fluid based page module enabled provides you with the createst flexibility. Earlier versions or with fluid based page module disabled should probably use $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['recStatInfoHooks'].
I personaly wouldn't add too many button visible by default on the top right of each content, because it will unnecessarily overloads the amount of information on the page module with action buttons that are not the most often used.
In particular, the "paste" button should only appears when there is something in the clipboard, and it now appears everywhere you can paste (you can see one above the content in your screenshot).
Cheers,
Rachel

How to create some custom box into a Typo3 web page?

I am very new in Typo3 world (I came from Joomla and WordPress) and I have some doubts related a thing that has been requested by a customer that use Typo3 for its site
He ask me to create some colored boxes into a specific page. Each of these boxes simply must contain text or links.
How can I do this?
I am thinking that I can solve in the following way (but I have not idea if this is a GOOD solution):
In the backend I go in the Page section and I open the settings related to the page that I have to modify
Here I have 3 columns (Left, Normal, Right) and for example I add a NEW Regular Text Element into this central column
Now appear to me the wysiwyg editor, so I click on the Toggle text mode icon and I pass from the wysiwyg mode to the pure HTML editor's mode and now I will create some div tags (settings the CSS settings for the background color and the dimension) that rappresent my boxes (and into these div I put their textual contents).
Is it a possible solution or is it a bad solution?
Tnx
Andrea
You may either use the RTE typoscript config to add some new paragraph styles, which will make the boxes or use the section_frame field in tt_content, a field called "frame" in the backend when you edit a content record. Both solutions would just need some typoscript (which you will deal with very often in the TYPO3 world) and CSS code.
If you need some more structure in the backend, there is also an extension for that called multicolumn. If you just need "more" columns in the backend (in combination with backend layouts) to achieve different looks, this can also be done by adding some typoscript config. To give you a more precise recommendation, some sort of scribble or design screenshot of what you want would be nice.

I want to create a vertically expanding content bar

Actually, I wanted to create a sidebar with 6 items, which show the content in a dropdown format.
For eg, if you click company, the content about company expands downwards, along with other five menu items. If you click any other item, the above one needs to close and this item should expand.
I want something like the sidebar in JsFiddle.net
Seems like what you are talking about is similar to jquery Ui's accordion:
Have a look at the link here to get you started: http://jqueryui.com/accordion/
Also don't forget to include jquery as well.http://jquery.com

Sitecore - how to persist a Layout change

I developed a Sitecore control I'd like to put into a layout on one page.
In this case it's a registration page, and my control is defined as a sublayout.
What I did is went into the Page Editor interface, and plonked the control into one of the placeholders.
What I want to do now is to create a package only containing the information that this control is on this particular page, without affecting e.g. the content or subitems of this node.
Can you please advise on the best way to create such packag, what exactly to select in the Package Designer?
Thanks
I don't believe the Package Designer gives you granular control to include just specific fields of an item. You need to add the item as whole.
You should configure layouts and renderings in the presentation details of an item OR even better in the __Standard Values of the template.
You can call the presentation details dialog through the content editor. Just select an item in the content tree, click on the Presentation tab in the top ribbon and select Details. You can configure all layouts/renderings for the selected item here.
But ff you want to prevent content changes you really SHOULD configure the presentation in the __Standard Values of the template. This is also the way, which is recommended by Sitecore. If you do this, the layouts are all you have to put into a package.

Adding the appropriate elements in SectionStackSections

I'm trying to build a similar menu like in http://www.gwt-ext.com/demo/#menuButton. But i am using the SmartGWT instead of GWT-Ext and GWT Designer in Eclipse. I have built the SectionStack and add to it 3 sections. My problem is that i do not know what components to add in each section to get the selected items as in the example 'Showcase Explorer' menu of the link. Like the example i want to fill each section with several text lines but if i add just Label components then there are not selectable like in the example (when you view the menu in accordion mode).
Why dont you use http://www.smartclient.com/smartgwt/showcase/#menus_category_treebinding this menu instead?