XH 1.6.4: Expandible Submenu

Discussions and requests related to new CMSimple features, plugins, templates etc. and how to develop.
Please don't ask for support at this forums!
Holger
Site Admin
Posts: 3470
Joined: Mon May 19, 2008 7:10 pm
Location: Hessen, Germany

Re: XH 1.6.4: Expandible Submenu

Post by Holger » Thu Dec 18, 2014 8:28 am

manu wrote:So what should we vote about? Tatas solution is pure CSS now as far as I can see. Therefore it's a template issue. Put a nice example into one of the standard templates and that's it.
cmb wrote:Tata, maybe you like to update your structure1_black template with such an expandible submenu? This way we don't have to change the "template tag" submenu(), but others could easily take the CSS and improve their templates. It seems to me that would be the best solution.
+1

Tata
Posts: 3586
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: XH 1.6.4: Expandible Submenu

Post by Tata » Thu Dec 18, 2014 10:11 am

I'll try to do it this weekend.
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

Tata
Posts: 3586
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: XH 1.6.4: Expandible Submenu

Post by Tata » Sat Dec 20, 2014 8:00 am

Well, I looked on the trick and it is not pure CSS solution. A small adjustment has to be done in tplfuncs.php and in stylesheet.css as well. However, it can be made in next CMSimple_XH release standardly (if not used, nothing may hapen).
Look for (class="submenu" shall be defined here and the h4 label shall be wrapped in a DIV)

Code: Select all

if (count($ta) != 0) {
            return '<h4>' . $tx['submenu']['heading'] . '</h4>'
                . li($ta, 'submenu');
        }
and change it to

Code: Select all

if (count($ta) != 0) {
            return '<div class="submenu"><h4>' . $tx['submenu']['heading'] . '</h4>'
                . li($ta, 'submenu').'</div>';
        }
also add

Code: Select all

/* SUBMENU */
.submenu{ margin-top: 1rem;}
.submenu ul {display:none;}
.submenu:hover ul {display:block;}
/* h4 has to be changed if menu_levels != 3 */
.submenu h4{font-size: 1rem; color: #008e00; text-stadow: none; font-weight: bold;}
.submenu h4:after {content: "(+)"}
Instead of "(+)" you may put any other sign or image.

I have not change the template, as there would also be necessary to change the whole structure. But I will try to make some simple template with included trick and drop here the link.

@EDIT

I just tested it without changes in tlpfuncs.php and it works if the submenu() call is wrapped in a DIV adjusted by class="submenu".
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: XH 1.6.4: Expandible Submenu

Post by cmb » Sun Dec 28, 2014 11:36 pm

Tata wrote:I have not change the template, as there would also be necessary to change the whole structure. But I will try to make some simple template with included trick and drop here the link.
That would be nice. It seems to be appropriate to add a respective section to the XH wiki, too.
Christoph M. Becker – Plugins for CMSimple_XH

Post Reply