Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: Sub Menus?
OK, the linklist is your main problem. For primary navigation, I usually handcode it, and use Textpattern tags for the submenu (see below). Also, the reason why nothing would show up is because of section="web-design" (note the hyphen). Change that to “webdesign” – the name of the section.
To display the web design article (not the portfolio items), make the article sticky, then replace the <txp:article /> (after <div id="content">) with <txp:article status="sticky" limit="1" />.
For your menu, remove the linklist. Then build your menu using the following. (I added in extra sections too.) Make sure the section attributes correspond to your actual section (same name).
Chunk of your sidebar (page template code)
<pre>
<--This is your menu-->
<dl>
<dt><txp:section link="y" name="webdesign" title="y" /></dt>
<txp:if_section name="webdesign">
<txp:article_custom form="menu-item" limit="6" section="webdesign" />
</txp:if_section>
<dt><txp:section link="y" name="photography" title="y" /></dt>
<txp:if_section name="photography">
<txp:article_custom form="menu-item" limit="6" section="photography" />
</txp:if_section>
<dt>About</dt>
<dd><a href="/portfolio/webresume.pdf">CV [pdf]</a></dd>
</dl>
</pre>
form: menu-item (Presentation>Form tab)
<pre>
<dd><a href="<txp:permlink />"><txp:title /></a></dd>
</pre>
Make sure you’ve turned auto-append comments off in the Admin tab too.
Last edited by jm (2006-09-21 04:28:43)
Offline
Re: Sub Menus?
OK. thanks for the further help, Jm, I’ll post back later to let you know how it goes. Sorry too, if my question sound silly. It’s just that I’m at the point where I’m unsure how to mix xhtml with txp codes…..
“Words have no wings but they can fly a thousand miles.” (Korean Proverb)
Offline
Re: Sub Menus?
Hey! I have it almost working. When you click on the sub tabs, those pages look out of wack but otherwise everything else is working out. I think the reason for the sub tab pages looking wierd has to do with a section or page issue. Maybe I’m not calling up the right template for those sub articles… Hmm. well I’ll keep working at it.
“Words have no wings but they can fly a thousand miles.” (Korean Proverb)
Offline
Re: Sub Menus?
raspberryheaven wrote:
OK. thanks for the further help, Jm, I’ll post back later to let you know how it goes. Sorry too, if my question sound silly. It’s just that I’m at the point where I’m unsure how to mix xhtml with txp codes…..
Hey, we all have to learn :). Once you get over the initial learning curve, templating will be as easy as HTML.
As far as the current display problems, it looks like it’s related to HTML comments. In Textpattern, the way to comment out TXP code is to use something like:
<code>
<txp:if_section name=“intentionallywrong”>
This is a comment on the TXP code. It won’t show up.
<txp:category_list />
</txp:if_section>
</code>
Offline
Re: Sub Menus?
so…I should delete or revise the html coding that is going on in the template?
“Words have no wings but they can fly a thousand miles.” (Korean Proverb)
Offline
Re: Sub Menus?
Ok. This is kind of wierd. Jm, I did what you suggested and I took out the <!— —> around txp tags that weren’t being used. ( I took the txp unused tags out too) and The template issue went away. However, the subpages no longer have text or content in them. I have some blurbs in each “article” for each page but now they are gone, even though, if i check in admin, I can clearly see that the text is still there. It doesn’t matter if i change the status of these three sub pages either. All that does is un-make the sub tabs.
sub tab links:
http://www.runjeeta.com/webdesign/11/vancouverfoodorg
http://www.runjeeta.com/webdesign/10/david-gifaldi
http://www.runjeeta.com/webdesign/9/rhizomes
So, any ideas how to fix?
Also, I’ve tried everything I can think of but on the web design page with the sub tabs , the menu is all in lowercase (except the sub tabs)! Why? I went back through the code you gave me and capitalized everything but it made no difference.
http://www.runjeeta.com/webdesign
Thanks for being patient!
raspberryheaven
Last edited by raspberryheaven (2006-09-24 19:27:20)
“Words have no wings but they can fly a thousand miles.” (Korean Proverb)
Offline
Re: Sub Menus?
No problem. Let’s simplify for now, and remove all formatting. Use this as your page template, and see if it works:
<code>
<txp:if_article_list>
<h2><txp:section title=“y” /></h2>
<p>The web design article – forgot what you were using.</p>
<txp:article limit=“1” status=“sticky” />
<h3>Secondary</h3>
<dl>
<dt><txp:section link=“y” name=“webdesign” title=“y” /></dt>
<txp:if_section name=“webdesign”>
<txp:article_custom form=“menu-item” limit=“6” section=“webdesign” />
</txp:if_section>
<dt><txp:section link=“y” name=“photography” title=“y” /></dt>
<txp:if_section name=“photography”>
<txp:article_custom form=“menu-item” limit=“6” section=“photography” />
</txp:if_section>
<dt>About</dt>
<dd><a href=”/portfolio/webresume.pdf”>CV [pdf]</a></dd>
</dl>
<txp:else />
<p>Now we’re viewing a single article, AKA one of the sidebar articles</p>
<txp:article />
</txp:if_article_list>
</code>
Also, can you enable debugging mode too?
For the titles, title="y" should do it. Have you specifed a title for the section in Presentation>Sections (names=url, title=Title of the section)?
Last edited by jm (2006-09-24 22:57:47)
Offline
Re: Sub Menus?
Yes, Jm I did specifiy a title and for the sections i have in the Section panel. And, yes I did type them in lowercase, however, It doesn’t seem to matter becuase on every page other then my web desiging page, the nav bar is in caps.
Also check out http://www.runjeeta.com/webdesign it looks funky, obviously but! on the sub pages, the text is back. I will re -introduce code back in until I find the problem, that is unless you have a better idea of what the problem is now.
thanks!
rh
Last edited by raspberryheaven (2006-09-24 22:39:14)
“Words have no wings but they can fly a thousand miles.” (Korean Proverb)
Offline
Re: Sub Menus?
All right! That’s progress :D.
First, let’s fix it so you’ve got the static, web design article again. I don’t know what ID your article was, but insert it in the id attribute below. EDIT: Just noticed an embarassing typo in the previous code. Instead of staus it should be “status”.
<code>
<p>The web design article – forgot what you were using.</p>
<txp:article id=“6” status=“sticky” />
</code>
That should get the sticky article back.
On to the plugin errors…dak_categories is pretty old, and doesn’t seem like it’s compatible with 4.0.3. From the tag trace, it seems like you could use this instead of the plugin:
<code>
<p class=“postmetadata”>
<txp:category1 link=“y” title=“y” /> | <txp:category2 link=“y” title=“y” />
</p>
</code>
Hope something works!
Offline
Re: Sub Menus?
Am I supposed to put this:
<code><txp:article id=“6” status=“sticky” /></code>
in the page the articles get their template from or in the actual article itself? Becuase, I dont understand, if it goes in the page, how its supposed to know what ID’s to call up. I mean do i type them all in?
Also, I turned off the offending plug in but I still have the dak_catagories errors on my pages. Only one, which is better than the huge list I had.
Thanks for your help.
Last edited by raspberryheaven (2006-09-25 03:29:13)
“Words have no wings but they can fly a thousand miles.” (Korean Proverb)
Offline
Re: Sub Menus?
Nope, it goes in the page template. It looks like you’ve got it fixed though.
A day in the life of a TXP page (abridged version):
<txp:if_article_list>- We are on an article list, AKA section homepage (/webdesign)
<h2><txp:section title="y" /></h2>- Display the title of the section wrapped in an
<h2>tag.
- Display the title of the section wrapped in an
<txp:article id="6" status="sticky" />- Since we’re on an article list, we only want this article, with the id of 6, to display entirely.
- Time to ouput the sidebar. Various HTML goes here. ex:
<div id="secondary"> <txp:if_section name="webdesign">- If the section we’re on is named “webdesign,” do stuff.
<txp:article_custom form="menu-item" limit="6" section="webdesign" />- yadayada…spit out the sub menu
</txp:if_section>
- We are on an article list, AKA section homepage (/webdesign)
<txp:else />- We are not on an article list. We are on a single article.
<txp:article />- Display the case-study/client article.
</txp:if_article_list>
Hope that explains it a little more.
Re: plugin error
I think you still have <txp:dak_categories ... /> in your sticky form/article form. Delete it.
EDIT: My nifty indenting didn’t work! Nested one too many bullets I guess :P.
Last edited by jm (2006-09-25 05:25:13)
Offline
Re: Sub Menus?
Thank you for the outline! I hope it helps once I sit down and go through it. I“ll tackle it tomorrow morning.
Thank you so much.
“Words have no wings but they can fly a thousand miles.” (Korean Proverb)
Offline