am-impact / amnav

Navigation plugin for Craft
168 stars 20 forks source link

How Can I display Parent of a specific Node? #56

Closed bgarrant closed 8 years ago

bgarrant commented 8 years ago

I am trying to display a node and it's parent and I can't figure it out. Here is my code:

            <h3>I NEED TO GET THE PARENT NODE TITLE HERE</h3>
                {{ craft.amNav.getNav("mainNavigation", {
                id: 'subnav',
                startFromId: 2,
                maxLevel: 1
            }) }}

What am I doing wrong?

bgarrant commented 8 years ago

Anyone know how to do this? I just need the Title of the parent node.

brettdewoody commented 8 years ago

Try starting from the parent node.

bgarrant commented 8 years ago

startFromId: 2 is the top level node. I just can't get it to display the parent node name, which in this case node 2 is "About". Any idea what I am missing?

Jammooka commented 8 years ago

Seeing as you know the id of the entry, just call it directly:

{{ craft.entries.id(2).first().title }}

hubertprein commented 8 years ago

I recon you figured it out.

If you need more help with this, please reopen the issue.