Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-09-26 22:21:56

brunodario
Member
From: Belo Horizonte, Brasil
Registered: 2007-09-19
Posts: 75

Create header/footer with little diferences btwen sections

Hi there guys, i´m a designer with little php experience working by the 1st time with txp .

Here´s the current deal: I´ve made this website using Dreamweaver and now it´s my goal to transform the static pages i´ve created onto dynamic ones.
My first question (expect lot’s of) is about how can i use forms to use and reuse header and footer that change a little bit from section to section..

The header is almost the same for every page, the diference betwen the sections are:

1- The top bar changes the color (it´s a 100% width x 20 px top bar where the RSS button is)

2- There´s a phrase on the head, i.e:

- Home page: The authentic Brazillian Spirit (wich is the site slogan) - Section Products: “Met the best cachaças in Brazil” - Section History: “The cachaca history, with humor!”
and so on

Despite of those itens the basic header layout stands for the rest. There´s a similar situation about the footer (RSS sign by mail.should point to the current section RSS).

Any sugestions on how i can create only one form that “reads” the changes trough sections?

Thx in advance and sorry bout my “more or less” english.

Offline

#2 2007-09-26 22:45:37

rsilletti
Moderator
From: Spokane WA
Registered: 2004-04-28
Posts: 707

Re: Create header/footer with little diferences btwen sections

I would start with Textbook (link under “Txp Network Links”), specifically here , given the description of what you need so far.

Offline

#3 2007-09-27 13:18:36

marios
Archived Plugin Author
Registered: 2005-03-12
Posts: 1,253

Re: Create header/footer with little diferences btwen sections

You can do sonething like this:

In your page_template/s:

<txp:output_form form=“dynamic_footer” />

And the form template:

<div id=“footer”>
<div id=“usual_stuff”> <!— Usual stuf here —>
</div> <txp:if_section name=”“> <h2><txp:site_slogan /></h2>
</txp:if_section >
<txp:if_section name=“sports”> <h2>Met the best cachaças in Brazil</h2>
</txp:if_section >
<txp:if_section name=“history”> <h2>The cachaca history, with humor!</h2>
</txp:if_section >
</div>

regards, marios

Last edited by marios (2007-09-27 13:21:01)


⌃ ⇧ < ⌃ ⇧ >

Offline

#4 2007-09-27 18:57:17

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Create header/footer with little diferences btwen sections

brunodario wrote:

The header is almost the same for every page, the diference betwen the sections are:

1- The top bar changes the color (it´s a 100% width x 20 px top bar where the RSS button is)

A nice thing to do is assign a class or id that is or contains the section name:

<div id="<txp:section />-header">

You will find the Tag Listing very useful.

Offline

#5 2007-09-27 20:51:31

brunodario
Member
From: Belo Horizonte, Brasil
Registered: 2007-09-19
Posts: 75

Re: Create header/footer with little diferences btwen sections

Very useful help, thx guys

Offline

Board footer

Powered by FluxBB