Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2007-04-04 13:43:27
- progre55
- Member
- Registered: 2006-05-02
- Posts: 668
One Article and Two Style Sheets
I apologize for what may seem like a repost, but I think now I can clearly (somewhat clearly) explain the situation.
- I have a single Article (Article A) assigned to Section (Section A)
- I have a Page (Page A) that lists all the Articles for Section A
- When you select an Article, using the permalink tag, you are sent to a Page (Page B) that contains all the details about the article.
What I want to do is duplicate this process without having to duplicate the articles? Why? I need to apply two seperate style sheets to the same article depending on the Detail Page it appears on.
I have combed the forum and I know that people have asked about applying to sections to one article. I think I am pretty certain this is not possible. So I am hoping someone can assist with a work around that could solve this specific issue.
Thanks again for the assistance.
progre55
Offline
Re: One Article and Two Style Sheets
- Create “Section A” and “Section B”
- Create “Page A” and “Page B” and assign them to the respective Sections (or use
<txp:if_section/>
on a single page) - For “Section A” use
<txp:article_custom section="Section B" form="article-form1" other_attributes="here..." />
for Section A - For “Section B” use
<txp:article form="article-form2" other_attributes="here..." />
Behavior
- When you go to Section A, you see a list of Section B articles using “article-form1”.
- When you click on one of these it will display using the section B form “article-form2”
- When you go to section B, you will see an article list of Section B articles using “article-form2”
Will that work?
Last edited by mrdale (2007-04-04 15:05:53)
Offline
#3 2007-04-04 17:41:07
- mapu
- Member
- From: Munich, Germany
- Registered: 2004-03-16
- Posts: 141
Re: One Article and Two Style Sheets
I would rather give the body-tags of the pages different ID’s, then you can work with one stylesheet.
Like on Page A:
<body id="page-a">
and on Page B
<body id="page-b">
And in the stylesheet:
#page-a .whatever {...}
#page-b .whatever {...}
So you can have different styles on different pages with one stylesheet.
Hope that helps.
Offline
Re: One Article and Two Style Sheets
Yep, you can do that too… in fact, the approach I was outlining assumes you are using one stylesheet. Using different forms, allows not only customizing the styling, but presentational order, and the content presented.
But yes, doing a <body id="<txp:section />">
will give you great presentational flexibility. If IE wasn’t so stupid, adding a <txp:category/>
would be even more useful.
Offline
#5 2007-04-05 00:47:23
- progre55
- Member
- Registered: 2006-05-02
- Posts: 668
Re: One Article and Two Style Sheets
Guys:
Thanks but, even if I do the following:
- Create “Section A” and “Section B”
- Create “Page A” and “Page B” and assign them to the respective Sections (or use
<txp:if_section/>
on a single page) - For “Section A” use
<txp:article_custom section="Section B" form="article-form1" other_attributes="here..." />
for Section A - For “Section B” use
<txp:article form="article-form2" other_attributes="here..." />
The problem with the above is that I do not think it takes into consideration the actual starting point (ie how do I get (Section A or B)
Right now, the way the site is designed, you run a search and come up with a list (table) of articles with some custom info in the other columns. From this list, there is the following code <a href="<txp:permlink />"><B><txp:title /></a>
Click on the title and you are sent to the asigned section and the style sheet assigned to that section.
Unfortunately, I can not figure out a method to duplicate this action, but send it to another location. I am even fine with duplicating pages and sections (I know probably not good coding) but the stickler for me is how do I get the <txp:permlink />
to look at a diffentet location. And if not the <txp:permlink />
is there another method to direct the entry to a particular section/page.
The one thing I can not do is duplicate articles.
Thanks again and sorry for the confusing post.
progre55
Last edited by progre55 (2007-04-05 00:48:42)
Offline
Pages: 1