Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#211 2012-02-06 19:37:40

Tony
New Member
From: Moscow
Registered: 2012-02-03
Posts: 4

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

This way the “Supply” item will also appear in the “Supply” submenu along with “Bread supply” and “Butter supply”, which is not the desired behaviour.

Offline

#212 2012-02-06 22:07:30

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

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

Tony wrote:

This way the “Supply” item will also appear in the “Supply” submenu along with “Bread supply” and “Butter supply”, which is not the desired behaviour.

Not if you restrict the menu to contain “live” articles only, using article_attr='status="live"'.

And then on the Supply page, you could do something like:

<txp:if_article_list>

	<txp:article status="sticky">
		<txp:title />
	</txp:article>

<txp:else />

	<txp:article>
		<txp:title />
	</txp:article>

</txp:if_article_list>

Give me a shout on email (via my website) if I’m still wide of the mark.

Offline

#213 2012-02-06 23:55:04

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

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

Version 1.2 available for download

  • section-specific article sort (for bg)
  • enhancement: adi_menu admin sections link to TXP section tab
  • fix: ampersands in article titles (thanks renobird)
  • fix: admin styling for Hive
  • now uses lifecycle events for install/uninstall, so TXP 4.2.0+ is now required

Offline

#214 2012-02-07 20:08:22

Tony
New Member
From: Moscow
Registered: 2012-02-03
Posts: 4

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

gomedia wrote:

Not if you restrict the menu…

Wow, this way I got the logic working! Many thanks, gomedia. This is rather a sophisticated solution, not on the surface. That I would not guess.

Offline

#215 2012-02-17 22:36:32

frickinmuck
Member
Registered: 2008-05-01
Posts: 118

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

Hi there, I’m having an issue in that I can’t get the default section to recognize the sort order. It keeps coming up first on the list. Is this by design? How can I get around that?


The AI does not hate you, nor does it love you, but you are made out of atoms which it can use for something else.

Offline

#216 2012-02-17 23:05:45

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

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

frickinmuck wrote:

Hi there, I’m having an issue in that I can’t get the default section to recognize the sort order. It keeps coming up first on the list. Is this by design? How can I get around that?

Try using default_first="0" – it’s on by default.

Offline

#217 2012-02-17 23:11:41

frickinmuck
Member
Registered: 2008-05-01
Posts: 118

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

Thanks.


The AI does not hate you, nor does it love you, but you are made out of atoms which it can use for something else.

Offline

#218 2012-03-22 23:19:26

elwins
Member
From: Latvia
Registered: 2011-08-29
Posts: 80

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

Totally nice plugin, really like it, but I have little problem.

I need menu, like this:

  • Menu 1 *
    1. Menu 1.2
    2. Menu 1.3
    3. Menu 1.4
    4. Menu 1.5
  • Menu 2 *
    1. Menu 2.2
    2. Menu 2.3
    3. Menu 2.4
    4. Menu 2.5

Okey, that I made, but how to made menu, who works like this: When I’m in Menu1, then I see only Menu1 submenus, when I’m in Menu2, then I see only Menu2 submenus, like this:

——————————————————-
  • Menu 1 *
    1. Menu 1.2
    2. Menu 1.3
    3. Menu 1.4
    4. Menu 1.5
  • Menu 2
    ——————————————————-
  • Menu 1 *
  • Menu 2
    1. Menu 2.2
    2. Menu 2.3
    3. Menu 2.4
    4. Menu 2.5
      ——————————————————-

Last edited by elwins (2012-03-22 23:30:42)

Offline

#219 2012-03-23 00:30:24

bg
Member
From: Pekin Illinois USA
Registered: 2005-02-20
Posts: 22
Website

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

Adi… I meant to thank you for this ages ago, but since I forgot, I’ll do it now ;)

Thank you!

gomedia wrote:

Version 1.2 available for download

  • section-specific article sort (for bg)
  • enhancement: adi_menu admin sections link to TXP section tab
  • fix: ampersands in article titles (thanks renobird)
  • fix: admin styling for Hive
  • now uses lifecycle events for install/uninstall, so TXP 4.2.0+ is now required

— Bob

Offline

#220 2012-03-23 01:11:20

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

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

elwins wrote:

Totally nice plugin, really like it, but I have little problem.

Try using current_children_only="1".

bg wrote:

Adi… I meant to thank you for this ages ago, but since I forgot, I’ll do it now ;)

Thank you!

My pleasure, and thank you for your thank you!

Offline

#221 2012-03-23 17:56:36

elwins
Member
From: Latvia
Registered: 2011-08-29
Posts: 80

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

Thanks, gomedia it works!

How to get class to second and third menu level, like SUBMENU1 and SUBMENU2 ?

<ul id="navigation">
<li class=""><a href="/home">Home</a></li>
<li class=""><a href="/about-us">About us</a></li>
<li class="active"><a href="/contacts">Contacts</a>
<ul class="submenu1">
<li class="active"><a href="/contacts/main-contacts">Main contacts</a></li>
<li class=""><a href="/contacts/employers">Contacts of employers</a>
<ul class="submenu2">
<li class="active"><a href="/contacts/main-contacts/office">Office</a></li>
<li class=""><a href="/contacts/employers/workshop">workshop</a></li>
</ul>
</li>
</ul>
</li>
</ul>

Now my menu code is like this:

 <txp:adi_menu current_children_only="1" active_li_class="active" active_ancestors="1" parent_class="" class="navigation" />

Last edited by elwins (2012-03-23 20:24:35)

Offline

#222 2012-03-23 22:30:30

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

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

elwins wrote:

How to get class to second and third menu level, like SUBMENU1 and SUBMENU2 ?

As you’re only listing submenus of the currently active section, you can use this for submenu1:

ul#navigation ul { ...}

And for submenu2:

ul#navigation ul ul { ...}

Alternatively, if you use list_id="1", you can target specific submenus, e.g.

ul#navigation li#menu_contacts ul { ...}

Offline

#223 2012-03-23 23:04:47

elwins
Member
From: Latvia
Registered: 2011-08-29
Posts: 80

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

Big Thanks! Didnt think about CSS! :))

Last edited by elwins (2012-03-23 23:24:54)

Offline

#224 2012-04-26 14:03:20

wornout
Member
From: Italy
Registered: 2009-01-20
Posts: 256
Website

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

I can’t publish to default section no more. Is the last version of adi_menu?

Offline

#225 2012-04-26 23:44:58

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

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

wornout wrote:

I can’t publish to default section no more. Is the last version of adi_menu?

Hi wornout,

OK, here’s the deal. You can’t assign articles to the default section, well, not in standard Textpattern anyway.

The ability was introduced in an early version of adi_menu (0.8 probably) and it’s a bug. In version 1.2, I introduced a mechanism that prevented this – it kicks in if there’re no existing articles in the default section. Websites that already have articles in default won’t be affected.

It’s been such a useful option, that has worked well for me, it’s taken a while to realise that it’s not allowed! Why shouldn’t the Home page have it’s own articles? Maybe I should ask one of my “Why does it have to be that way” questions.

Anyway, here’re the options when using version 1.2 & above:

  • For existing websites:
    • Keep calm and carry on – if you’ve got articles in the default section then adi_menu will still allow you to add more. If there aren’t any, you won’t be allowed to go down that path
    • Don’t panic – if you don’t like the idea of default articles then reassign them to a different section and adjust your home page accordingly. As soon as the last one is taken out of default, adi_menu will quietly hide the option
  • For new websites:
    • Nothing to be seen here, move along now – you can’t have articles in the default section

Offline

Board footer

Powered by FluxBB