Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2008-11-04 22:55:14
- zeusdidit
- Member
- Registered: 2007-10-16
- Posts: 111
how to style a category with multipe blogs and sections.... help
I’m not sure how to achieve this using sections, or categories and I think I’m just adding more than I need.
I imagined that if I used
<txp:section name=“camps”>
this will show how the page should look for all camp pages in this section
<txp:if_category name=“Camp-Miami”>
<show this sticky post across all sections that use Came Miami using the form=“thisStyle”>
</txp:if_category>
</txp:section>
<txp:if_individual_article>
<show this sticky post across all sections that use Came Miami using the form=“thisStyle”>
+ <txp:article_cutsom “show_post”>
</txp:if_individual_article>
I think somewhere in the information above I’m just doing something incorrectly in the way my forms, or in the TXP code. I came to realize that if I put the
section after the category it won’t affect the style of the section, but I’m not sure that’s the right way to go.
I need help since this was due Monday. If someone is available please email me, post or I can send my phone number. I’ll keep pluggin away to figure out if I can get the categories to look one way for multiple blogs. If I can’t someone just let me know.
Many thanks.
Zeus
Last edited by zeusdidit (2008-11-06 16:28:55)
Offline
#2 2008-11-04 23:17:01
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: how to style a category with multipe blogs and sections.... help
I must say that I don’t really understand your site structure, but if it works – apart from the styles you want – it doesn’t seem sensible to change it when you have so little time.
One question: when you say ‘style’ do you mean CSS or the grouping of the articles?
Offline
#3 2008-11-04 23:24:36
- zeusdidit
- Member
- Registered: 2007-10-16
- Posts: 111
Re: how to style a category with multipe blogs and sections.... help
If you can tell me an easier way to accomplish this, I will. The framework is done, but I don’t mind starting over even if takes all night.
The site structure is
Main Nav (sections):
* About
* Donate
* Ride
* Events > these are events (categories Parent Events, Events2, Camp 1, Camp 2)
* camps > these are blogs (categories, Parent Camps, Camp 1, Camp 2)
* Learn (one page)
* Gallery (one page)
* Sponsors
So there are training camps, one is called camp miami. When you click on camp miami, I need to show a page that has 4 short blogs entries + to the right should be some camp details. (The camp details is a “sticky” page which should persist). SOMEHOW I need to figure out how to show “Events” it’s own section and it’s own category for this camp.) Now I have to do this for 7 Camps.
I figured I’d use a form to set the style, but I’m not getting the page to display just the one Camp (category).
i’m not even sure if this post helps, but at least you have the site structure so if you see an ‘easy’ way out, let me know. :)
Thanks!
Last edited by zeusdidit (2008-11-06 16:29:22)
Offline
#4 2008-11-04 23:49:15
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: how to style a category with multipe blogs and sections.... help
OK, just to see if I’m getting it right:
- You need a page ‘Camp Miami’ with
- 1 sticky article from section ‘camps’ and category ‘camp miami’ (or is this not an article but static content that could also be in a form?)
- 4 articles from section ‘camps’ and category ‘camp miami’
- and you need a page ‘Events for Camp Miami’? with
- articles (events) from section ‘events’ and category ‘camp miami’
and this for all 7 camps (categories). Right?
Offline
#5 2008-11-05 00:05:30
- zeusdidit
- Member
- Registered: 2007-10-16
- Posts: 111
Re: how to style a category with multipe blogs and sections.... help
Els wrote:
OK, just to see if I’m getting it right:
- You need a page ‘Camp Miami’ with
- 1 sticky article from section ‘camps’ and category ‘camp miami’ (or is this not an article but static content that could also be in a form?)
— This is an article, but I made it sticky, not sure how to make static content.. - 4 articles from section ‘camps’ and category ‘camp miami’
— The 4 articles should be short, when you click on one, you get the full details (along with that sticky article)
- 1 sticky article from section ‘camps’ and category ‘camp miami’ (or is this not an article but static content that could also be in a form?)
- and you need a page ‘Events for Camp Miami’? with
— yes, if it’s easier, I’ll put all “camp events” into it’s own category if it’s easier ( i was considering moving it under blogs)- articles (events) from section ‘events’ and category ‘camp miami’
—yes… it’s a mess huh?
- articles (events) from section ‘events’ and category ‘camp miami’
Last edited by zeusdidit (2008-11-05 00:07:20)
Offline
#6 2008-11-05 00:17:54
- zeusdidit
- Member
- Registered: 2007-10-16
- Posts: 111
Re: how to style a category with multipe blogs and sections.... help
Let me know if you want me to post some code… :) and thanks.
Offline
#7 2008-11-05 00:41:55
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: how to style a category with multipe blogs and sections.... help
No I wouldn’t call that a mess ;) Shouldn’t be too hard. Let me know if this looks like what you had in mind:
(I’m assuming here that you have one page template for both your sections ‘camps’ and ‘events’.)
<txp:if_section name="camps">
<txp:if_article_list>
<txp:if_category name="camp-miami,camp-2,camp-3,etcetera">
<txp:article limit="1" status="sticky" form="yourform" />
<txp:article limit="4" form="excerptform" />
</txp:if_category>
<txp:else />
<txp:article form="fullarticleform" />
</txp:if_article_list>
</txp:if_section>
<txp:if_section name="events">
<txp:if_article_list>
<txp:if_category name="camp-miami,camp-2,camp-3,etcetera">
<txp:article limit="4" form="excerptform" />
</txp:if_category>
<txp:else />
<txp:article form="fullarticleform" />
</txp:if_article_list>
</txp:if_section>
If you don’t need excerpts with links to full articles on your Events page, that last part can be just this:
<txp:if_section name="events">
<txp:if_category name="camp-miami,camp-2,camp-3,etcetera">
<txp:article limit="4" form="eventform" />
</txp:if_category>
/txp:if_section>
(I assume you know how to code your excerpt forms and full article forms?)
You can link to the camps pages like this:
<txp:category_list categories="camp-miami,camp-2,camp-3,etcetera" section="camps" wraptag="ul" break="li" />
and to the events pages exactly like that only replace section="camps"
with section="events"
.
Last edited by els (2008-11-05 00:43:03)
Offline
#8 2008-11-05 02:04:51
- zeusdidit
- Member
- Registered: 2007-10-16
- Posts: 111
Re: how to style a category with multipe blogs and sections.... help
I think I mis-explained. I need it for 7 Different Blogs or 7 different mini-sites.
So:
7 ( Individual camp nav and logo + blog list + blog description + event detail + event description )
I think what you gave me was a way to use a container type (article_list) which allows me to set categories. I think your solution really could work, but I’ll try to see if the follow may work, or do you not suggest using something like :
<txp:if_article_list>
<txp:if_category name="camp-miami">
<txp:article limit="1" status="sticky" form="camp_main" />
<txp:article limit="4" form="article_post" />
</txp:if_category>
<txp:if_category name="camp-2">
<txp:article limit="1" status="sticky" form="camp_main" />
<txp:article limit="4" form="article_post" />
</txp:if_category>
<txp:else />
<txp:article form="fullarticleform" />
</txp:if_article_list>
<!-- marking separator -->
<txp:if_section name="thisSection">
<txp:if_section name="learn">
<txp:article limit="1" form="article_zStyled" section="camps" id="23" limit="1" /> <!-- is this correct static page syntax? I've never asked before... -->
</txp:if_section>
If the above is plausible, if it’s incorrect I don’t mind making it smarter or faster with a bit of work. The only part I haven’t added is the individual page display. I’d like that to be automated so if I create a new camp it just knows to add it, but I’m not sure that’s possible.
Also, I’m not sure if this may be us discussing how to handle a Multi-Blog thread with Textpattern. Does that sound like what we’re doing?
:) be cool if it was…
Last edited by zeusdidit (2008-11-05 02:15:43)
Offline
#9 2008-11-05 15:28:44
- zeusdidit
- Member
- Registered: 2007-10-16
- Posts: 111
Re: how to style a category with multipe blogs and sections.... help
Hey, this is almost working using your code, but how do I get just the “Section” part to look different from the other parts?
Offline
#10 2008-11-05 17:28:30
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: how to style a category with multipe blogs and sections.... help
zeusdidit wrote:
I think I mis-explained. I need it for 7 Different Blogs or 7 different mini-sites.
That should work, because <txp:article />
is context sensitive and therefore will automatically pull articles from the right category and/or section. But it looks like you already figured that out :)
Hey, this is almost working using your code, but how do I get just the “Section” part to look different from the other parts?
I don’t quite understand, what is the ‘section’ part exactly? Can you post your code and tell me which part needs a different styling?
Offline
#11 2008-11-05 18:00:15
- zeusdidit
- Member
- Registered: 2007-10-16
- Posts: 111
Re: how to style a category with multipe blogs and sections.... help
Here’s a look at what I’m using. I think I may have to create multiple sections and multiple pages so each can retain it’s own look unless you have a better option. :) thanks again.
<div id=“content”>
<!— leftside —>
<h1><img src=”/imgs/hdr_training.gif” /></h1>
<txp:article limit=“1” status=“sticky” form=“post_rightSide_camp” /> <!— put this on every page —>
<txp:if_article_list>
<txp:article limit=“6” form=“article_post” />
<txp:else />
<txp:article form=“article_post_show_camp” /><!— not passing category variable so I lose the style above the if_article_list—>
</txp:if_article_list>
<txp:if_section name=“camps”>sdfsd I need this to be different hence why I thought creating separate sections would solve the issue
</txp:if_section>
<!— start footer area —> <txp:output_form form=“footer” /> </div><!— content —>
Last edited by zeusdidit (2008-11-05 18:04:40)
Offline
#12 2008-11-05 23:18:15
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: how to style a category with multipe blogs and sections.... help
If the articles are in the right place, and you only need to change the look, you can add divs wherever you want. Either on the page, like this:
<txp:if_article_list>
<div class="<txp:section />-list">
<txp:article limit="6" form="article_post" />
</div>
<txp:else />
<div class="<txp:section />-post">
<txp:article form="article_post_show_camp" />
</div>
</txp:if_article_list>
(This will create classes camps-list
, camps-post
, events-list
and events-post
.)
or in your article forms, then you can even have a different style per category (camp) if you wish, e.g.:
<div class="<txp:category1 />-post">
your form content
</div>
which will give you classes camp-miami-post
, camp-latte-post
, etcetera.
Does this help?
Offline