TYPO3: Navigation with different colors - colors

Hy everyone. I am an neebie in Typo3 and i want to ask how is this possible to make a navigation with different colors. It must look like that
<ul>
<li>NavItem 1
<ul>
<li>SubItem1
<ul>
<li>SubsubItem1</li> <--- when active to red
</ul>
</li>
<li>SubItem2
<ul>
<li>SubsubItem2.1</li><--- when active to red
<li>SubsubItem2.2</li><--- when active to red
<li>SubsubItem2.3</li><--- when active to red
</ul>
</li>
</ul>
</li>
<li>NavItem 2</li><--- third level item to blue on active
<li>NavItem 3</li><--- third level Item to green on active
<li>NavItem 4</li>
<li>NavItem 5</li>
<li>NavItem 6</li>
</ul>
All other third level Items must be in the specified color when they active.
Is this possible in Typo3?
Thanks for your answers :)

what you are looking for is optionSplit.
f.e.
1.NO.ATagParams = class="red" || class="blue" || class="green" ...
The || indicates optionSplit - it will split each menu item.
I am not sure, if optionSplit works on ATagParams, at least you can use it on wrapItemAndSub or allWrap.
1.NO.allWrap = <li class="red">|</li> || <li class="blue">|</li> || ...

Related

Subline Text paste and indent windows 10

Using sublime text 3 cutting and then paste and indent using Ctrl+Shift+V it doesn't do what I think it should do:
<div>
<div></div>
</div>
function(){
test;
}
The expected result should be:
<div>
<div></div>
</div>
function(){
test;
}
Am I missing something?
This is not how Paste and Indent works. It is intended for situations when you copy a line or lines with one indentation and paste it into a block with a different indentation. For example:
<ul class="list1">
<li>One</li>
<li>
<ul class="innerList">
<li>OneA</li>
<li>OneB</li>
| <li>Three</li>
</ul>
</li>
<li>Two</li>
<li>Four</li>
</ul>
Now, I want to copy the line where the cursor is (containing <li>Three</li>) from innerList to list1. If I just do copy and paste (CtrlV), the indentation is wrong:
<ul class="list1">
<li>One</li>
<li>
<ul class="innerList">
<li>OneA</li>
<li>OneB</li>
<li>Three</li>
</ul>
</li>
<li>Two</li>
| <li>Three</li>
<li>Four</li>
</ul>
However, if I do "paste and indent" (CtrlShiftV):
<ul class="list1">
<li>One</li>
<li>
<ul class="innerList">
<li>OneA</li>
<li>OneB</li>
<li>Three</li>
</ul>
</li>
<li>Two</li>
| <li>Three</li>
<li>Four</li>
</ul>
The indentation is corrected for the current context. To do what you want to do, you'd need to use one of the many HTML and/or JS formatting plugins available on Package Control. I personally use HTML-CSS-JS Prettify, which runs on top of Node.js, but there are plenty to choose from.
as i remember there is Beautiful Html extension well be useful for your issue

Prestashop 1.7 attribute groups - check stock and apply css to unavailable combination

Prestashop option to hide unavailable attributes on product page doesn't work when attribute groups are used, for example color and size (for clothing shops).
I need to keep showing all possible combinations, but grey out (or strikethrough) the combinations with no stock.
Like this:
I tried several things.
In Prestashop 1.6 the following piece of code worked to apply css class (.out-of-stock-float-left) to unavailable combinations:
{elseif $group.group_type == 'radio'}
<ul id="group_{$id_attribute_group}">
{foreach from=$group.attributes key=id_attribute item=group_attribute}
{if {$group.attributes_quantity[{$id_attribute|intval}]} > 1} <!-- product in stock -->
<li class="input-container float-left">
<input class="input-radio" type="radio" data-product-attribute="{$id_attribute_group}"
name="group[{$id_attribute_group}]"
value="{$id_attribute}"{if $group_attribute.selected} checked="checked"{/if}>
<span class="radio-label">{$group_attribute.name}</span>
</li>
{else} <!-- product out of stock -->
<li class="input-container out-of-stock-float-left">
<input class="input-radio" type="radio" data-product-attribute="{$id_attribute_group}"
name="group[{$id_attribute_group}]"
value="{$id_attribute}"{if $group_attribute.selected} checked="checked"{/if}>
<span class="radio-label">{$group_attribute.name}</span>
</li>
{/if}
{/foreach}
</ul>
{/if}
When changing combinations there is an ajax request. I don't know how to grey out combinations with no stock and make them not clickable.
Thanks

Dynamic depth with GWcode Categories

I'm having trouble wrapping my head around how to create a dynamic menu with GWcode categories in ExpressionEngine. I would like the menu to go a certain depth only for current {segment_2} (parent) category and the rest of the parent categories to just stay a depth of 1.
For instance, if the url was: domain.com/products/medical-tables-cabinets/eta-classic-series/ it would output this:
<ul class="nav-menu">
<li>Power Tables</li>
<li class="active submenu">Medical Tables & Cabinets
<ul class="nav-submenu">
<li>ETA Alpha Series</li>
<li class="active submenu">ETA Classic Series
<ul class="nav-submenu">
<li>Entry A</li>
<li>Entry B</li>
<li>Entry C</li>
</ul>
</li>
<li>Style Line Cabinet Models</li>
<li>Echo Image Series</li>
<li>Bariatric Series</li>
<li>Family Practice</li>
<li>Treatment & Bedside Cabinets</li>
<li>Managed Care Quick Cabinets</li>
<li>Recovery Couches</li>
</ul>
</li>
<li>Pediatric Equipment</li>
<li>Medical Seating</li>
<li>Blood Drawing Chairs</li>
<li>Tubular Steel & Accessories</li>
<li>Physical Therapy Equipment</li>
<li>Kangoo by Clinton</li>
<li>Training Room Furnishings</li>
<li>Index by Model #</li>
<li>Clinton-Eco Tables</li>
</ul>
I got it working, but I still need to go a little deeper. Here is the basic concept:
{exp:gwcode_categories
channel="products"
style="linear"
}
{if depth1_start AND segment_2 != cat_url_title}
<li>{cat_name}</li>
{/if}
{if depth1_start AND segment_2 == cat_url_title}
<li class="active submenu">{cat_name}
<ul class="nav-submenu">
{/if}
{if depth == 2 AND segment_2 == parent_url_title}
<li{if segment_3 == cat_url_title} class="active"{/if}>{cat_name}</li>
{/if}
{if depth1_end AND segment_2 == parent_url_title}
</ul>
</li>
{/if}
{/exp:gwcode_categories}

Ideal way to handle layout changes in a list

So I've stupidly designed a list of recent articles, all is good with the world BUT the first 2 entries html are markedly different then the remainder of entries.
I am yet to turn a line of code so any advice anyone an offer is greatly appreciated.
Simplistically the ul would look like:
<li class="1of2"> /* It's number 1 – give it a class to identify it as special */
<h1>{title}</h1>
<p>{short_desc}</p>
</li>
<li class="1of2"> /* It's number 2 – give it a class to identify it as special */
<h1>{title}</h1>
<p>{short_desc}</p>
</li>
<li> /* It's not number 1 or 2 – ie. every other item, NO class per se */
<h1>{title}</h1>
<p>{short_desc}</p>
</li>
If you imagine a 3 column grid for all entries but the first 2 entries are 1.5 columns each. Bit of a noodle scratch going on here, any thoughts gratefully voted upon.
PS. I will be using Stash if that helps !
Just output the class name based on the value of {count}. I've output the whole opening <li> tag here to keep it simple but you could just output the class attribute or class name itself.
{if count<=2}
<li class="special">
{if:else}
<li>
{/if}
<h1>{title}</h1>
... etc.
</li>
Incidentally, I don't think you can have class names that begin with a number.
Here's how I would do it if you want each of the first 2 to have a unique class name:
<li{if count<=2}class="top{count}"{/if}>
that will output
<li class="top1">...
<li class="top2">...
<li>...
If you want the first 2 items to have the same class:
<li{if count<=2}class="whateveryouwant"{/if}>
which will output
<li class="whateveryouwant">...
<li class="whateveryouwant">...
<li>...
Couldn't you do {if count == "1|2"}class="whatever"{/if} ?
Seems you are asking for two unique classes, one for the first entry and one for the second entry. In that case, this will work:
{if count == 1}
<li class="first">
<h1>{title}</h1>
<p>{short_desc}</p>
</li>
{if:else if count == "2"}
<li class="second">
<h1>{title}</h1>
<p>{short_desc}</p>
</li>
{if:else}
<li>
<h1>{title}</h1>
<p>{short_desc}</p>
</li>
{/if}
Also, class names that start with a number will not validate.
You could do it with simple conditionals as well if there is no "other" class that would then require the if:else part of the conditional:
<li{if count == "1"} class="first"{/if}{if count == "2"} class="second"{/if}">
<h1>{title}</h1>
<p>{short_desc}</p>
</li>
This assumes you don't have any other differences, such as different custom fields in one option versus the other, which MediaGirl's suggestion would handle more elegantly. If the only difference between them is class assignment, this is another alternative.

Joomla Menu Customize

How do I customize a Joomla Menu? I have a MainMenu with 1 row 1 item menu. I want to customize the menu with example style: 1 item 2 row. (each row each text field).
Now:
<ul class="menu">
<li class="item-464">
Home
</li>
<li class="item-444 active deeper parent">
About
</li>
</ul>
To:
<ul class="menu">
<li class="item-464">
<a href="#">
<span style="display:block">Home</span>
<span style="display:block,font-size:10px">Home</span>
</a>
</li>
<li class="item-444 active deeper parent">
<a href="#">
<span style="display:block">About</span>
<span style="display:block,font-size:10px">About</span>
</a>
</li>
</ul>
You just need to assign the items with a Parent Item of the first level in Menu Manager > Main Menu > Edit Menu Item which will create a menu tree as you add sub items.

Resources