Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to Make noLinkFormat work with jQuery UI Accordion #9

Closed
larry-tx opened this issue Feb 21, 2013 · 2 comments
Closed

Trying to Make noLinkFormat work with jQuery UI Accordion #9

larry-tx opened this issue Feb 21, 2013 · 2 comments

Comments

@larry-tx
Copy link

I'm trying to make the noLinkFormat parameter work with jQuery UI Accordion. Theoretically, I need to surround the non-linking menu entry with something distinguishable to jQuery like

tags. Here's what I tried initially:

In the helper array:

'Menu.MenuBuilder' => array(
'noLinkFormat' => '

%s

',
'authField' => 'role',
'authVar' => 'user',
'authModel' => 'Users.User'
),

In the menu array itself:

array(
'title' => 'Learning Resources',
'permissions' => array(''),
'children' => array(
array(
'title' => 'Collections',
'url' => 'admin/collections/index',
and so

Unfortunately, that produced unclickable "Learning Resources" entry in the menu that looked like this in the source code:

  • Home
  • Learning Resources

      So I changed my menu array to look like this:

      array(
      'title' => 'Learning Resources',
      'url' => '#',
      'permissions' => array(''),
      'children' => array(
      array( and so on

      However, cake-menu then totally ignored my noLinkFormat parameter and produced this kind of source code:

    • Home
    • Learning Resources
      • With that, I don't see anything that I can hook jQuery UI accordion onto. Am I missing something? Is there a way to do that? Or to set the parameters to create the kind of hooks that it needs?

  • @torifat
    Copy link
    Owner

    torifat commented Feb 22, 2013

    Can you please tell what you are trying to achieve?

    @larry-tx
    Copy link
    Author

    I'm trying to make the noLinkFormat parameter work with jQuery UI Accordion. That mean that the non-linking elements of the menu array need to be surrounded by a HTML block element, preferably <h3>. All of the link elements under a non-linking element need to be surrounded by <div></div>. For example:

       ```<h3>Widgets</h3>
        <div>
            <ul>
                <li><a href="/widgets/add">Create Widget</a></li>
                <li><a href="/widgets/index">List Widgets</a></li>
            </ul>
        </div>
        <h3>Foo Bar</h3>
        <div>
            <ul>
                <li><a href="/foo_bar/add">Create Foo Bar</a></li>
                <li><a href="foo_bar/index">List Foo Bars</a></li>
            </ul>
        </div>```
    

    As I'm sure you're aware, the jQuery Accordion widget is a very commonly used component of jQuery. Surely there must be a way to use it with the wonderful cake-menu_builder.

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    None yet
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants