Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-10-07 12:20:30

daikw
Member
Registered: 2007-10-06
Posts: 39

How can I create this textpattern layout

Hi there, just installed text pattern onto my new site, and am really excited, but unfortunately am held back by my lack of programming experience (I am more designer than programmer!)

Here is what I would like to do with textpattern.
I have a very rough idea about how it might be done (by creating a new section for each site) but I have no idea how to populate the sites with the correct articles, embed static elements, or apply a separate stylesheet to each ‘site’.

So here’s a diagram I’ve drawn of what I want. Apologies it isn’t embedded.

http://www.daikurebayashi.com/dscf0437.jpg

<a href=“http://www.daikurebayashi.com/dscf0437.jpg”>

And here is the detailed description:

Each SITE* (see the tabs at the top “SITE A/SITE B/SITE C comprises of a news feed on the left and a group of fixed items on the right: a flash mp3 player, mini-gallery, and gig listing.

When I post articles I would like to label them so that

Articles TYPE A, TYPE B, and TYPE C appear on SITE A
TYPE B appears on SITE B
TYPE C appears on SITE C

In addition I would like to use a separate style sheet for each site, so although SITE A and SITE B will display some of the same articles, they will appear differently on each (e.g. a using a different frame border, font, and bg color)

Now, I’m sure this is all fairly straightforward for the experienced texpattern user, but unfortunately this is my first time designing a site from scratch using a CMS. I know how HTML works and I understand CSS basically, but I feel that even after reading the textbook and searching the forum, this is a little out of my depth. If someone could take me though the steps required, and then refer me to relevant reading I would be very appreciative.

Thanks again.

Dai

Last edited by daikw (2007-10-07 12:25:21)

Offline

#2 2007-10-07 13:04:20

quinceginger
Member
From: Romania
Registered: 2006-08-21
Posts: 29

Re: How can I create this textpattern layout

Offline

#3 2007-10-07 21:46:11

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,726
Website

Re: How can I create this textpattern layout

Yes, check too the two articles by destry wion at the end of the link quinceginger gave you. They’re a long read but you’ll have a much better idea after reading them.

You might find it worthwhile/easier to check the textgarden/textplates for templates that are close to yours in principle and then go about adapting them to fit your own needs.

To get you going: you have three sites with different content but more or less the same basic structure – blog articles on the left, fixed gallery, news etc. on the right.

As the structure is basically the same you only need make one page template. To style them differently you can set up a different stylesheet for each (presentation > styles). Then under “presentation > sections” make a section for each artist/site – make them use the same page template (under “uses page:”) and set the stylesheet to the ones you created before (under “uses style:”).

If your site design changes only very little, e.g. colours, header background graphic etc. you could use the same stylesheet for all three and using a CSS trick give each section its own identity by prefixing it with the section. In the page template give the body tag an id=“section-name” (e.g. <body id="<txp:section />">). In your stylesheet you can then style those bits that are different for each site by prefixing them with with section, e.g.:

#header { display:block; height:60px; width:800px; } /* layout for id="header" */
#site-a #header {background: black url(site-a-headergraphic.jpg) top left no-repeat; } /* specific to site a */
#site-b #header {background: pink  url(site-b-headergraphic.jpg) top left no-repeat; } /* specific to site a */
#site-c #header {background: white url(site-c-headergraphic.jpg) top left no-repeat; } /* specific to site a */

Each article you write you assign to the appropriate section. For material you want to share between the different sections, I suggest you make an extra section for them (e.g. news) or use categories to distinguish between types of information. Then use txp:article_custom on your page template to pull in articles from that section or category. txp:article is context-sensitive and shows articles assigned to the section you are in, txp:article_custom you can make pull in articles from elsewhere – you can use both in alongside each other for different parts of the same page template (e.g. txp:article for blog articles and txp:article_custom for news).


TXP Builders – finely-crafted code, design and txp

Offline

#4 2007-10-08 14:54:29

daikw
Member
Registered: 2007-10-06
Posts: 39

Re: How can I create this textpattern layout

Thanks to you both for your advice and suggested reading, I am now a lot more informed!

One more thing I need to ask is about the tabs at the top of the page.

I want to be able to direct people to a site either with tabs, or without.

This is because some visitors will only be interested in one artist, so the inclusion of navigation tabs will be confusing and irrelevant.

Here is a diagram of what I want:

http://www.daikurebayashi.com/dscf0437-1.jpg

If a visitor types in “ www.sitea.com/sitec “ they get site c with the tabs at the top.
if they simply type in “ www.sitec.com “ they get the page with no tabs.

I have two ideas for how this could be done, but I don’t know if they’re possible or which (if any) is best.

1. Create two page templates. One will be loaded when the user types in “ sitea.com/sitec “ and the other (which is identical, but minus the tabs) is loaded when they type in “ sitec.com “. Is it possible to load different pages depending on the URL typed in?

2. Create a html frame at the top of the page containing just the tabs.
“ sitea.com/sitec “ loads a frameset containing the tabs frame and the txp frame underneath.
“ sitec.com “ loads just the txp frame.
Is it possible to navigate through txp using external html buttons in this way?

Many thanks for your continued support!

Dai

Offline

#5 2007-10-09 18:46:55

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,726
Website

Re: How can I create this textpattern layout

Hmm, that’s more tricky as you’re trying to manage several domains through one installation.

Take a look at the ied_if_domain plug-in. I’ve not tried a setup like you’re suggesting it but I think it may do exactly what you want. Also do a search for multiple domains in the forum. I’m sure it’s come up before.

Another way might be to host each site as subsections of the main domain and use server-pointer redirectors for your various domains that redirect to the appropriate section. An example: let’s say it’s a record company with various bands on their books and you have the following setup.

www.recordcompany.com (set up full site on this account with /band-a, /band-b, /band-c…)

www.band-a.com is just a domain name that redirects to www.recordcompany.com/band-a
www.band-b.com is just a domain name that redirects to www.recordcompany.com/band-b

I suppose you could set a cookie (see chs_cookie) when arriving via the redirect and in txp you can then conditionally display the navigation with or without tabs depending on the cookie – for direct visitors where cookie=yes don’t show tabs, for those who have come through the main domain (and have no cookie), show tabs.
All you need now is to find out where the visitor has come from. Thinking aloud, you could append a flag to your redirect from www.band-a.com, e.g. make it redirect to www.recordcompany.com/band-a&?visit=direct. Then you could use chs_ifurlvar to test if the url variable visit=direct and if so set the cookie “no tabs”.
Maybe there’s a more elegant way with referer-sniffing…

I don’t think your option 2 with framesets will work – possibly a solution with iframes where the entire band site is embedded in the iframe.


TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB