Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#121 2009-07-20 14:06:05

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,373

Re: adi_menu – section hierarchy, section menu and breadcrumb trail

Cedric wrote:

… the currently active article doesn’t get the “active_class” attribute. Any ideas?

Yes, you’re right it doesn’t. However, there’s a some hidden functionality in adi_menu that might help – it’s probably time to bring it out of the closet. I’ll contact you via email.

Offline

#122 2009-07-22 09:45:39

Aeron
Member
Registered: 2009-06-02
Posts: 11

Re: adi_menu – section hierarchy, section menu and breadcrumb trail

Firstly, awesome plugin! Works magic when combined with ‘stm_article_order’. I’ve got two questions which I want to know if this plugin can achieve:

1. Is there the possibility to include a ‘form’ from within a section li? Or better still, have the section be able to be rendered using a form similarly to the articles ie. ‘adi_menu_articles’

Basically I’m trying to achieve a first level section output such as this.

<li><a class="XX" href="<txp:site_url />" title="XXXXXX"><img class="XXXX" src="img/home.gif" width="98" height="32"><span>XXX</span></a>

or

<li><a class="XX" href="<txp:site_url />" title="<txp:custom_field name="nav_title" />"><img class="XXXX" src="XXXX" width="XX" height="XX"><span><txp:title/></span></a>

2. And second question is whether it is possible to have header or divider within the artciles (or sub menu).
ie. achieve something such as this:

<li><a class="xxx" href="<txp:site_url /></a>
		<ul>
		<li><span class="header" >Header</span></li>
		<li><a href="<txp:site_url />">How to Apply</a></li>
		<li><span class=divider" ></span></li>
		<li><a href="<txp:site_url />">Apply Now</a></li>
		</ul>
</li>

While I type this I’m thinking I could achieve this by having blank articles, and using a combination of a custom field and IF statements. Before I experiment, do you know if this could be achieved, or is already possible?

Thanks in advance.

Last edited by Aeron (2009-07-22 10:43:01)

Offline

#123 2009-07-22 10:56:14

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,373

Re: adi_menu – section hierarchy, section menu and breadcrumb trail

Aeron wrote:

Firstly, awesome plugin! Works magic when combined with ‘stm_article_order’.

Glad you find it useful.

1. Is there the possibility to include a ‘form’ from within a section li? Or better still, have the section be able to be rendered using a form similarly to the articles ie. ‘adi_menu_articles’

Interesting thought … I’ll have to think.

2. And second question is whether it is possible to have header or divider within the artciles (or sub menu).

Inserting dummy <li> for the purposes of formatting probably violates some sensible rule somewhere. How about using CSS in conjunction with some adi_menu attributes: ‘first_class’, ‘last_class’ & maybe ‘list_prefix’?

Offline

#124 2009-07-22 13:10:42

Aeron
Member
Registered: 2009-06-02
Posts: 11

Re: adi_menu – section hierarchy, section menu and breadcrumb trail

gomedia wrote:

Interesting thought … I’ll have to think.

Great, this would make the menu a lot more flexible. One of the main reasons why this would be useful, aside from styling, is to add variables for SEO.

Inserting dummy <li> for the purposes of formatting probably violates some sensible rule somewhere.

Your probably right, but… I’ll cross that bridge when I come to it.

How about using CSS in conjunction with some adi_menu attributes: ‘first_class’, ‘last_class’ & maybe ‘list_prefix’?

I’ll see what I can come up with, I’ve only been learning TXP for a few weeks.

Offline

#125 2009-07-27 15:50:43

Aeron
Member
Registered: 2009-06-02
Posts: 11

Re: adi_menu – section hierarchy, section menu and breadcrumb trail

I am playing around with the code for the sections, and I am wondering if it is at all possible to add IDs directly within links? ie.

<li><a href="<txp:site_url />" id="menu_home">Home</a></li>

instead of:

<li id="menu_home"><a href="<txp:site_url />">Home</a></li>

Offline

#126 2009-07-27 21:43:49

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,373

Re: adi_menu – section hierarchy, section menu and breadcrumb trail

Aeron wrote:

I am playing around with the code for the sections, and I am wondering if it is at all possible to add IDs directly within links? ie.

<li><a href="<txp:site_url />" id="menu_home">Home</a></li>

instead of:

<li id="menu_home"><a href="<txp:site_url />">Home</a></li>

What’s the reason for wanting to do this? The advantage of having IDs on the <li> is that it gives you a hook to reference the <li> and everything inside it.

Offline

#127 2009-07-27 22:48:06

Aeron
Member
Registered: 2009-06-02
Posts: 11

Re: adi_menu – section hierarchy, section menu and breadcrumb trail

The reason for this is so I can apply a background images to individual sections that make up the menu, without affecting all the items beneath it.

Offline

#128 2009-07-27 23:25:41

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,373

Re: adi_menu – section hierarchy, section menu and breadcrumb trail

In the case of:

<li id="menu_home"><a href="<txp:site_url />">Home</a></li>

to specify a background on the <a> in CSS, how about:

li#menu_home a { background:blah blah; }

Offline

#129 2009-07-28 00:33:03

Aeron
Member
Registered: 2009-06-02
Posts: 11

Re: adi_menu – section hierarchy, section menu and breadcrumb trail

li#menu_home a { background:blah blah; }

The above is what I have tried, however the background image gets applied to the sub-menu backgrounds as well because the closing </li> is not applied till the end of the submenu ie.

<li id="menu_home" class="menuparent">
	 <a href="http://localhost/xxx"><span>home</span></a>
	   <ul>
	      <li>
		 <a rel="bookmark" href="http://localhost/xxx2">Commercial Section</a>
	      </li>
  	   </ul>
</li>

Offline

#130 2009-07-28 01:08:53

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,373

Re: adi_menu – section hierarchy, section menu and breadcrumb trail

The sub-menu <li> should have it’s own ID as well, so you can override any inherited style,
e.g. for individual sub-menus

li#menu_home a { background:blah blah; }
li#menu_commercial a { background:none; }

or for all sub-menus under Home:

li#menu_home li a { background:none; }

or all sub-menus in the menu:

li li a { background:none; }

Offline

#131 2009-07-28 06:52:15

Aeron
Member
Registered: 2009-06-02
Posts: 11

Re: adi_menu – section hierarchy, section menu and breadcrumb trail

Thanks for pointing out the options, however the way the menu is coded, doing so does not change the sub-menu styles. The only way I can get the menu to work is by assigning IDs to the individual links.

If you know a way to do so, I’d love to know.

Offline

#132 2009-07-28 07:09:55

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,373

Re: adi_menu – section hierarchy, section menu and breadcrumb trail

Aeron wrote:

If you know a way to do so, I’d love to know.

Please contact me via my website – you can either send me the code & styles or give me a link to look at it online.

Offline

Board footer

Powered by FluxBB