Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2007-08-24 19:12:47
- richoid
- Member
- Registered: 2006-04-25
- Posts: 11
First page in a section gets custom heading?
I’m just pulling my templates done in DreamWeaver into TextPattern. I’ve set up sections, and for “pages” within each section, I’m setting up “categories”. So now I have three things to figure out:
a) I need to figure out how to statically link from the buttons to each section/category. The navigation on this site is not dynamic, it will be fixed. It is not a blog. So I have old-fashioned rollover graphical buttons for each category within each section. The sectional navigation is more like modern css: text with backgrounds in divs. (the customer is attached to the design of the rollover buttons, btw).
b) I need to have the “home” page (home category) of each section to display a different header than the secondary pages of the section. I’ve tried creating something like this:
<txp:if_section name=“default”><txp:if_category name=“home”><img scr=“img1.gif”><txp:else><img scr=“img2.gif”></if_category></if_section>
but that doesn’t seem to work right, for some reason. Just swapping stuff by section worked, but the nesting seemed to kill the deal. In other words, if I take out the “if_category” the if/else works sectionally. Is there another way to nest?
c) I intend to make a “page” and, if necessary, a style for each section. I hope this is the right logic? Since the navigation within the sections differs from section to section, and isn’t dynamically generated by the database, the only alternative I can think of is using <txt:if> tags with a different form for each block of sectional nav buttons. I think that might be confusing if someone else had to edit the pages, later.
I’d be grateful for any help/advice or pointers to solutions.
Offline
Re: First page in a section gets custom heading?
a) there shouldnt be any issues linking to each section statically. you just do it like normal. ie <a href=”/section_name”>section_name</a> (assuming you’re using clean urls.) if you’re using messy, <a href=”/index.php?s=section_name”>section_name</a>. etc etc
ps.you can make graphic rollover buttons with css as well. it just involves moving the background img positioning upon hover
b) not knowing exactly how things are setup on your end, i’ll leave someone else to assist you here.
c) sounds about right. some ppl like having one ‘page’ for all of their sections by using if conditionals. others might want a little more organization using pages for each section.
Last edited by iblastoff (2007-08-24 20:29:37)
Offline
#3 2007-08-24 20:10:58
- richoid
- Member
- Registered: 2006-04-25
- Posts: 11
Re: First page in a section gets custom heading?
Heh. Being a newbie, I keep expecting to see txp tags for everything. I thought I was missing something, standard <a href> makes sense.
So the sectional/category stuff makes sense, that’s great. But getting a different graphic to appear with the nexted if_section/if_category tags… any clues?
Offline
Re: First page in a section gets custom heading?
b. Hmm, should this work, but you need a plugin wet_if_page
<txp:if_section name="blog">
<txp:wet_if_page page="1">
<img src="/images/1.png" alt="" />
<txp:else />
<img src="/images/2.png" alt="" />
</txp:wet_if_page>
</txp:if_section>
Cheers!
Last edited by Gocom (2007-08-24 21:10:48)
Offline
#5 2007-08-25 00:11:59
- richoid
- Member
- Registered: 2006-04-25
- Posts: 11
Re: First page in a section gets custom heading?
Thank you. Much bowing and scraping to your lovely geekiness. I will try getting wet.
Offline
Re: First page in a section gets custom heading?
If the page structure is essentially identical, another potentially simpler way is to use css and give your HTML body tag an id-attribute with the section and/or category. Then you simply change the header as a background image in css, e.g.
body#section1_category1 #header { background: #fff url("/images/1.png"); }
body#section1_category2 #header { background: #fff url("/images/2.png"); }
body#section2 #header { background: #fff url("/images/3.png"); }
...
TXP Builders – finely-crafted code, design and txp
Offline