Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#136 2009-08-24 13:16:13

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

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

Bloke wrote:

Adi, this is one comprehensive plugin! Nice work.

Thanks.

Is it possible to make Adi menu display section Titles in the select list on the Write tab instead of Names?

I would think it’s entirely possible. I probably picked names instead of titles because that’s what’s used by default. I’d need to have a fiddle. Leave it with me.

Offline

#137 2009-09-07 20:00:29

woof
Member
Registered: 2004-08-01
Posts: 128

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

Hi Adi – Thanks for a great plugin. I’m including articles (articles="1") and have a question about sorting them – I guess its not directly possible but perhaps someone can suggest a workaround.

So far the only method I can find to influence this plugin’s sorting of articles is renobird’s suggestion of combining it with stm_article_order but I would like to sort by a custom field value and wonder if there is any way to achieve this? Thanks

Offline

#138 2009-09-07 21:59:05

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

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

woof wrote:

… I would like to sort by a custom field value and wonder if there is any way to achieve this?

Just off the top of my head, perhaps you could set a sort number in a article custom field and then use adi_menu attribute:

article_attr='sort="custom_2" limit="12"'

Offline

#139 2009-09-07 22:42:53

woof
Member
Registered: 2004-08-01
Posts: 128

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

gomedia wrote:

article_attr='sort="custom_2" limit="12"'

Bingo! – that works perfectly. Thank you.

Offline

#140 2009-10-05 23:00:09

caruso_g
Member
From: Catania
Registered: 2009-04-11
Posts: 88
Website

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

Adi,
this is probably the best plugin I discovered for Textpattern, thanks a lot for all of your efforts and time in developing it. :D
I have a question on a need I have on a website I am developing.
I need to show articles as the second sub-level of a website menu build on sections as top level made with your plugin. Hiding the default section, the next first item is product. Giving the product section “selected by default” option I am able to show the articles on the home page.
Now the problem: how can I assign to the product navbar item created with your plugin the class “active” on the home page?
I am sure it is a newbye question, thanks in advance for your help.

Offline

#141 2009-10-06 09:09:59

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

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

Hi Giuseppe,

Not sure I quite understand what you’re asking. In principle the “active” class is section sensitive, in some way or another, so only the section that’s being displayed will show up as active.

Is this set up online anywhere I can see it?

Adi

Offline

#142 2009-10-06 10:42:36

caruso_g
Member
From: Catania
Registered: 2009-04-11
Posts: 88
Website

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

Adi, thanks for your great support. :)
It is still not alive. But I can try to explain it as better as I can.
I have three sections: Products, support, store.
I want the index page to show a short list of products, so with your plugin I will not show the default item, but just “Products | Support | Store”
So, landing on the home, I would like to set “Products” as the active link in the navbar since, products, will not have a landing page, it will be the home itself to mimic the Product page and I will be able to just visit its children (article that represent product items in the products section).
The structure, on the home page, should be like :

  • Products (class:active)
    • item 1
    • item 2
    • item 3
  • Support
  • Store

Thanks so much for your help.

Offline

#143 2009-10-08 09:59:18

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

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

caruso_g wrote:

… So, landing on the home, I would like to set “Products” as the active link in the navbar since, products, will not have a landing page, it will be the home itself to mimic the Product page …

Hmm, I think the short answer is no.

As I mentioned before, adi_menu is section sensitive – so when you land on the “home” page, the section called default is active. When the visitor goes to the Products page, then it becomes the active section.

Maybe you could approach it another way? Would having an automatic redirect from the default/home page to the Products page help? That way the user would aim for www.mywebsite.com, but get redirected to www.mywebsite.com/products – where the Products menu item would then be active.

Offline

#144 2009-10-08 11:09:44

caruso_g
Member
From: Catania
Registered: 2009-04-11
Posts: 88
Website

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

Hi Adi,
yes, you are right, it is not possible to do it. I searched for a solution too with no luck.
I figured another solution though. I set the product landing page to one Sticky article, which will be the first article sorted by custom fields value. This way I can create a presentation page for products directly in home page without the need to duplicate it in the actual Product page.
To solve the “current” issue, I set an id to the body tag based on the section, so that when default it will be “home” and a css selector #home ul#navbar li#products to assign the .current style to it when on the home page.
That said, if you feel it could be useful, could you add an option to add specific classes and ids to menu elements when on the home page?

Thanks anyway, your plugin rocks.

Offline

#145 2009-10-11 19:06:24

caruso_g
Member
From: Catania
Registered: 2009-04-11
Posts: 88
Website

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

Adi,
may I request you for a new feature?
It would be really useful to have another option for list: list_class="Boolean"
It would let me style in the css a section link as current in the home page just using div#products ul.navbar li.menu_products but above all I can use more then a navbar in the home (like in the current project). For the moment I am using ids that, of course, don’t validate. I will show you the project hopefully in a few days.
Thanks again.

Offline

#146 2009-10-12 22:21:50

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

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

caruso_g wrote:

may I request you for a new feature?

Let me know when it’s ready & I’ll have a look.

Offline

#147 2009-10-21 14:49:52

caruso_g
Member
From: Catania
Registered: 2009-04-11
Posts: 88
Website

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

Adi,
here it is if you want to take a look at it:
Texts From John

As you can see it is quite particular as a website, that’s why I needed such features.
I sadly solved just hardcoding it, but I still think those features could further expand the possibilities of your already great plugin.
Thanks for all of your help.

Offline

#148 2010-02-13 22:38:08

ttr
Member
Registered: 2006-10-26
Posts: 34

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

Hello Adi.
First I want to thank you for this great piece of code, which will save me a lot of time in the future.

After the installation of your plugin I discovered problems with displaying of sections. I got garbage instead of correct sectionnames (you must know they are all in russian).
So I decided to take a look over the source and fortunately I fixed it in 2 minutes.
The problem is in the adi_menu_htmlentities function. It makes use of PHP functions htmlspecialchars() and htmlentitties(). Both functions use ISO-8859-1 as default charset. My TXP-installation (and many others) uses UTF-8. All I had to do was to override the defaults.

function adi_menu_htmlentities($string) {
// escape supplied string using:
// 	htmlentities (ALL special characters translated)
//	or htmlspecialchars (only & " ' < > translated)
	global $escape;
	if ($escape == 'html') $string = htmlentities($string, ENT_COMPAT, 'UTF-8');
	if ($escape == 'htmlspecial') $string = htmlspecialchars($string, ENT_COMPAT,'UTF-8');
	return $string;
}

I think this would also fix the problem with accented chars, so your plugin doesn’t need the escape-attribute, you introduced with 0.9.1… and therefore the adi_menu_htmlentities function is obsolete. Just htmlentities with correct attribute for clean code. :) Textpattern uses UTF-8 as default, so there is no need for a charset-detection I think.

I hope my post was helpful. Cheers.

Last edited by ttr (2010-02-13 22:39:05)

Offline

#149 2010-02-13 23:43:35

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

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

ttr wrote:

I hope my post was helpful. Cheers.

Hi Paul. Yes your post was very helpful, thanks. Much obliged.

Adi

Offline

#150 2010-02-17 21:42:03

ttr
Member
Registered: 2006-10-26
Posts: 34

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

Hi Adi.
I’m playing with your plugin for hours now and little by little I go insane.
Is it possible to render a menu with top-level sections and children only of a current section somehow?

Let’s say I have three sections:
  • A
  • B
  • C
    and if I click on B it should be rendered as:
  • A
  • B
  • B1
  • B2
  • B3
  • C

Offline

Board footer

Powered by FluxBB