Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: How to make a menu
@GugUser thanks for the help. One question why do you use the span tag?
As far as the default page/form i should be more careful when starting a new site. in this case i am updating my first TxP site to be more robust. My first effort was pretty basic and I unwitting used the default page. i do try to create a home one and use that.
again thanks
…. texted postive
Offline
#17 2015-03-03 03:17:18
- GugUser
- Member

- From: Quito (Ecuador)
- Registered: 2007-12-16
- Posts: 1,477
Re: How to make a menu
bici wrote #288691:
One question why do you use the span tag?
In some cases the spans are useful for the CSS. If you don’t need them, you can remove them. No problem.
Offline
Re: How to make a menu
I am trying to create a menu with sections and categories using the TXPTIP article
I have the following forms:
NAV – misc form
<txp:section_list form="navbuild" class="" break="" wraptag="" sections="default,about,archive,galleries,contact" />
NAVBUILD – article form
<txp:if_different> <li<txp:if_section name='<txp:section />'> <txp:if_individual_article><txp:else />class="current-menu-item"</txp:if_individual_article></txp:if_section>> <txp:section link="1" title="1" /></li> </txp:if_different> <txp:if_section name='<txp:section />'> <txp:article_custom section='<txp:section />' form="navbuildlinks2" /> </txp:if_section>
NAVBUILDKINKS2 – article form
<li class="current-menu-item"<txp:if_article_id> class="sub-menu"</txp:if_article_id>> <a href="<txp:permlink />"><txp:title /></a></li>
it’s more less working fine. Except that I don’t want sub-menus to appear for About and Contact Sections as they simply have only one entry each.
clicking on About causes the entry title to also appear as … “ About “ > “What Are We About” , when Section is not active only the “About” is visible.
For galleries it works like I wanted with subcategories appearing once we are on the Galleries sections/categories.
I tried limiting by section IDs but not with any success.
Is there a way to ONLY show the subcategories for the section Galleries??
…. texted postive
Offline
Re: How to make a menu
UPDATE:
I solved this issue via brute force.
I hand code navigation this way:
<li id="menu-item" class="menu-item"><a href="http://mysite.net" id="navHome" title="Fresh Rides" accesskey="h">Home |</a></li>
<li<txp:if_section name="about"> class="current-menu-item"</txp:if_section>>
<txp:section link="1" title="1" name="About" />
</li>
<li<txp:if_section name="archive"> class="current-menu-item"</txp:if_section>>
<txp:section link="1" title="1" name="Archive" />
</li>
<li<txp:if_section name="galleries"> class="current-menu-item"</txp:if_section>>
<txp:section link="1" title="1" name="Galleries" />
</li>
<li id="menu-item" class="menu-item"><a href="http://mysite.net/contact" id="abut" title="Contact Me"> Make Contact</a></li>
then when one lands on the galleries section where i want to show Galleries and its categories I have this code:
which is called by a form misc nav
<li id="menu-item" class="menu-item"><a href="http://mysite.net" id="navHome" title="Fresh Rides" accesskey="h">Home |</a></li>
<li<txp:if_section name="about"> class="current-menu-item"</txp:if_section>>
<txp:section link="1" title="1" name="About" />
</li>
<li<txp:if_section name="archive"> class="current-menu-item"</txp:if_section>>
<txp:section link="1" title="1" name="Archive" />
</li>
<!-- woot! -->
<li<txp:if_section name="galleries"> class="current-menu-item"</txp:if_section>>
<txp:section link="1" title="1" name="Galleries" />
<txp:article_custom section='<txp:section />' form="navbuildlinks2G" />
</li>
<!-- //end -->
<li id="menu-item" class="menu-item"><a href="http://mysite.net/contact" id="cbut" title="Contact Me"> Make Contact</a></li>
navabuildlinks2 has this ;
<!-- works --> <li class="current-menu-item"<txp:if_article_id> class="sub-menu"</txp:if_article_id>><a href="<txp:permlink />"><txp:title /></a></li>
it’s not as automagic as i had wanted but good enough for me.
After ten years i’ll be updating to new version of my in a week or so.
…. texted postive
Offline