Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2010-07-24 15:26:33
- yvette
- New Member
- Registered: 2010-07-24
- Posts: 4
Post Articles to Static Page "Categories"
Hello All
I’m a very new Textpattern user. I’ve searched the forum threads and tried examples with no success and need expert help with a task that may seem relatively easy to a seasoned TXP professional. Thank you in advance for your help
yvette
Site Design:
Excerpts of articles from all categories appear on the front page.
Excerpts of Articles from the front page appear in assigned categories.
Category list on all pages.
4 static pages [ About, Content, Links, Mailing List].
Problem:
I need excerpts of articles from the front page to appear in the categories of [About, Content, Links, Mailing List] . No articles appears.
example:
about/?c=“lifestyle”
content/?c=“lifestyle”
links/?c=“lifestyle”
mailinglist/?c=“lifestyle”
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Connect >>>> dmi<txp:page_title /></title>
<link rel="home" href="<txp:site_url />" />
<txp:feed_link flavor="atom" format="link" label="Atom" />
<txp:feed_link flavor="rss" format="link" label="RSS" />
<txp:rsd />
<txp:css format="link" n="dmiblog.css" title="Connect >>>>dmi" />
<txp:css format="link" media="print" n="print.css" />
<!--[if lt IE 8]>
<script src="http://ie7-js.googlecode.com/svn/version/2.1(beta4)/IE8.js"></script>
<![endif]-->
</head>
<body>
<div id="container">
<!--Header-->
<txp:output_form form="header" />
<!--Body-->
<!--Navigation-->
<txp:section_list wraptag="ul" break="li" include_default="1" default_title= "home" sections=", about, contact, links," active_class="active" class="nav2"/>
<!--Articles | Sidebar-->
<txp:output_form form="sidebar" />
<!--Articles | Main-->
<div id= "main">
<txp:article limit="1" form="static.article" status="sticky" />
<!--***if category header-->
<txp:if_section name="about">
<h4 class="categoryhead"><span class="categoryhead">Articles</span> | <txp:category title="1" /><txp:image id="10" class="image10" /></h4>
<txp:article allowoverride="0" listform="default_list" pgonly="0" searchall="1" searchsticky="0" sort="Posted desc" status="4" />
</txp:if_section >
</div><!--Main Closing Div-->
<!--Footer-->
<txp:output_form form="footer" />
<!--Closing Container-->
</div>
</body>
</html>
Offline
Re: Post Articles to Static Page "Categories"
Excerpts of articles from all categories appear on the front page.
- Don’t use categories. Use sections instead.
- Make sections appear on the front page by activating ‘show on front page’.
Please inhale Textpattern Semantic Model
Excerpts of Articles from the front page appear in assigned categories.
Replace ‘categories’ with sections.
Category list on all pages.
Publish articles to the appropriate section.
Categories are additionally used to offer a site wide content filter.
4 static pages [ About, Content, Links, Mailing List].
Which are sections and not ‘categories’.
Problem: I need excerpts of articles from the front page to appear in the categories of [About, Content, Links, Mailing List] . No articles appears.
Will be solved once you use sections instead of categories.
(Of course you can filter by categories or keywords later but please understand the section concept first.)
example:
about/?c=“lifestyle”
content/?c=“lifestyle”
links/?c=“lifestyle”
mailinglist/?c=“lifestyle”
(I am not sure what you want to achieve.)
The biggest structure issue you need to understand is that using sections is the way to go first.
(!) Content categories and content keywords are working section independent and both are no site structure elements!
Sections are structure elements – like separated apartments inside a house.
Or like separated companies in a town.
After setting up the city structure you can dynamically filter all companies by categories or keywords.
Get all online mentions of Textpattern via OPML subscription: TXP Info Sources: Textpattern RSS feeds as dynamic OPML
Offline
#3 2010-07-24 16:54:20
- yvette
- New Member
- Registered: 2010-07-24
- Posts: 4
Re: Post Articles to Static Page "Categories"
Markus thank you for your help !!
I used the wrong terminology. I do have the pages set up in “sections” the index page/section is the front page and the articles are posted in different categories .
The 4 static sections are [ About, Content, Links, Mailing List]
When I’m in the About section and select a category from the category list ,the url is……about/?c=“lifestyle” and no articles from the category appear on the page. The same is true for the other static sections.
Please see the link below. If you go to the about section and select a category no articles appear in the respective category. Thank you
yvette
http://yw.freehostia.com/dmiblog/textpattern-4.2.0/
I need the articles to appear in each section
Offline
Re: Post Articles to Static Page "Categories"
If you don’t mind putting your site in debugging mode, it will be easier to find (and show) what’s happening. (For instructions see the link in my sig.)
Code is topiary
Offline
Re: Post Articles to Static Page "Categories"
yvette wrote:
I used the wrong terminology. I do have the pages set up in “sections” the index page/section is the front page and the articles are posted in different categories.
OK
The 4 static sections are [ About, Content, Links, Mailing List]
OK
When I’m in the About section and select a category from the category list ,the url is……about/?c=“lifestyle” and no articles from the category appear on the page. The same is true for the other static sections.
Categories: The clean URL should be site.com/category/category-name/
Navigation: To link to categories you need to use txp:category (for category list output forms mainly), txp:category1 or txp:category2
If you need to list (!) articles from a section filtered by category you must use txp:article_custom in your form for the list (!).
The txp:article tag is automatically restricted to the current section (except/unless you’re using it on the home page) and does not allow to filter by category.
Last edited by merz1 (2010-07-27 12:56:29)
Get all online mentions of Textpattern via OPML subscription: TXP Info Sources: Textpattern RSS feeds as dynamic OPML
Offline
#6 2010-07-24 18:21:38
- yvette
- New Member
- Registered: 2010-07-24
- Posts: 4
Re: Post Articles to Static Page "Categories"
Jeff
Thank you for your help! I’ve put the site in debugging mode.
Markus
I’ll try working with the tags above. How do I get a clean URL ? Thank you!!
yvette
Offline
Re: Post Articles to Static Page "Categories"
As Markus says, the regular <txp:article />
tag will only show articles from the section in the URL (unless you’re on the home page). If you remove the this_section="1"
from your category_list
tag, then clicking on a category link will work the same way it does from the home page.
You should only use the this_section
setting if you want to restrict article
to show articles that are both in that category and that section.
Having an “index” section might not be the best way to leverage sections.
Last edited by jsoo (2010-07-24 20:15:54)
Code is topiary
Offline
Re: Post Articles to Static Page "Categories"
How do I get a clean URL ? Thank you!!
In your case it should be easier to work with messy URLs first to eliminate a possible error source. You can always enable clean URLs later. Here is how it is done:
- Choose your preferred URL scheme ‘Preferences: Permanent Link Mode’ in admin settings
- You need a little addition to your .htaccess file:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+) - [PT,L]
RewriteRule ^(.*) index.php
</IfModule>
jsoo
… the regular <txp:article /> tag will only show articles from the section in the URL (unless you’re on the home page).
Thanks for the addition. I forgot to mention this & added it above.
Last edited by merz1 (2010-07-27 12:57:23)
Get all online mentions of Textpattern via OPML subscription: TXP Info Sources: Textpattern RSS feeds as dynamic OPML
Offline
#9 2010-07-25 02:36:35
- yvette
- New Member
- Registered: 2010-07-24
- Posts: 4
Re: Post Articles to Static Page "Categories"
Markus & Jeff
I made the change to the category list and it worked like a charm. Thank you not only for explaining how the tags work but also for pointing me to the documents. Both were helpful in gaining an understanding about what I was doing and why it was working. I appreciate your time and your help!
yvette
Offline