Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-07-09 22:33:06

lister
Member
Registered: 2008-02-13
Posts: 76

getting to grips with textpattern - newbie

Hi everyone..

I am looking to update my site using text pattern. I have been reading Textpattern Book and so far I understand most sections. My current site is http://www.precociouscollective.com

At the moment it is really simple, 3 sections, Home, Artist and Exhibitions. Im also looking to include a small blog section as well.

The templates and css will stay the same. The Home page will have its own template and the rest will use the 2col template.

My confusion is I dont really understand setting up forms with conditional statements like if/else. I suppose this would be the most beneficial way to get things to work as it just swaps content when you click the navigation..

Also The artist page has 12 different artists thumbnails (links) all directing to there own page.(at the moment I have some lightbox/iframes, but this will change to a basic page/template).

could anyone help me with some basic building blocks? I know its a tall order but i could do with some help understanding the logic involved, as I am pretty new to textpattern.

thanks

lister

Offline

#2 2008-07-09 23:17:14

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

Re: getting to grips with textpattern - newbie

My confusion is I dont really understand setting up forms with conditional statements like if/else.

See the ‘I’ section of the TextBook. Here’s an example, assuming default (home), artist, and exhibitions all use the “default” page template:

<txp:if_section name="">
    <txp:hide>Homepage content here</txp:hide>
<txp:else/>
    <txp:hide>Template for other sections</txp:hide>
</txp:if_section>

Or if you want more control:

<txp:if_section name="">
    <txp:hide>homepage/search/category</txp:hide>
</txp:if_section>

<txp:if_section name="artists">
    <txp:hide>artists template</txp:hide>
</txp:if_section>

<txp:if_section name="exhibitions">
    <txp:hide>exhibitions template</txp:hide>
</txp:if_section>

Also The artist page has 12 different artists thumbnails (links) all directing to there own page.(at the moment I have some lightbox/iframes, but this will change to a basic page/template).

  • Post each artist page as its own article
  • Use article image for the thumbnails

page: default

<txp:if_section name="artists">
    <txp:article form="artist_thumbs"/>
</txp:if_section>

form: artist_thumbs

<txp:permlink>
    <txp:article_image thumbnail="1"/>
</txp:permlink>

Offline

#3 2008-07-14 23:39:04

lister
Member
Registered: 2008-02-13
Posts: 76

Re: getting to grips with textpattern - newbie

I really appreciate the reply. I have really simplified things just to get my head round the whole concept with textpattern.

At the moment I am using a default template (the home page layout). I have dropped in the conditional tags to change when each nav/button is clicked. All seems fine but when you first visit the site (virtual) you get the URL of http://precocious.dev/textpattern/.

You can click through the nav and the relevant text appears within that section. Problem is when I click the home button the URL changes to http://precocious.dev/textpattern/home/
and nothing is displayed.

Are the navigation tags messing up??
here is the code

lister

Offline

#4 2008-07-15 00:06:19

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: getting to grips with textpattern - newbie

Well do you have section called home? if not, then the 404 error message is correct. If you want to link to the home page, then change the section list to something like:

<txp:section_list active_class="my_active_class" break="li" class="" default_title="home" sections="artists,exhibitions" include_default="1" wraptag="ul"/>

Last edited by Gocom (2008-07-15 00:06:54)

Offline

#5 2008-07-18 21:06:48

lister
Member
Registered: 2008-02-13
Posts: 76

Re: getting to grips with textpattern - newbie

Thanks that worked a treat….

Offline

Board footer

Powered by FluxBB