Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2012-07-23 11:59:34

alarius
Member
Registered: 2009-05-28
Posts: 45

something wrong in my menu and homepage

Hi everybody. About three years ago I tried to use textpattern, I had to leave it and now I’m starting again (but I loose everything I made).
So I read the manual and the forum, I tried to make my site (on localhost at the moment) really simple, with a left side with a menu and a central part with the container.
I wrote some articles and I assigend them all on the section “articles”, and some different subcategories
With the txp tags:

<txp:article_custom category='<txp:category_list parent="menu" exclude="menu" break=","><txp:category /></txp:category_list>' />

I obtain on left side a subcategory list (menu)
- news
- travel
- tech
- sport
and selecting one subcategory I obtain the list of articles on that subcategory. This is good.

But this works only if i put the section “articles” on frontpage in the tab “sections”. If I do not, I don’t obtain the list of articles on the central part, seems that is no articles over that subcategory.
At the same time I wrote one article called “homepage” in a section called “homepage” and sticky, in order to have it on the homepage. But this never appens, even if I put that section on frontpage in the tab “sections”.
The txp code I’m using on the central content area is:

<div id="contentarea">
<txp:if_category>
<h3><txp:category title="1" /></h3>
<div class="hfeed">
<txp:article form="article_listing" limit="500" />
</div>
<txp:else />
</txp:if_category>
<txp:if_individual_article>
<txp:output_form form="single" />
</txp:if_individual_article>
</div>

probably there is something I wrong, but I cannot understand what…
I tryed to search on the forum but probably there is something I don’t understand on the tags.
So thank you if you will help me

Last edited by jstubbs (2012-07-23 12:09:21)

Offline

#2 2012-07-23 12:14:50

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: something wrong in my menu and homepage

From a quick review of the above, you have no call for an article list, only individual articles or categories.

What about:

<div id="contentarea">
<txp:if_category>
<h3><txp:category title="1" /></h3>
<div class="hfeed">
<txp:article form="article_listing" limit="500" />
</div>
<txp:else />
...this is not a category...does this need to be here?
</txp:if_category>
<txp:if_individual_article>
<txp:output_form form="single" />
<txp:else />
....we are on a list page, show something here like...
<txp:article />
</txp:if_individual_article>
</div>

Offline

#3 2012-07-23 12:43:44

alarius
Member
Registered: 2009-05-28
Posts: 45

Re: something wrong in my menu and homepage

thankyou jstubbs for the fast response!
using

<txp:article limit=1 />
</txp:if_individual_article>
</div>

it seems to work well, thankyou!

Last edited by jstubbs (2012-07-23 12:58:31)

Offline

#4 2012-07-23 13:01:14

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: something wrong in my menu and homepage

You are welcome and happy its working for you. Please feel free to ask more questions, that is what the community is here for.

You emailed about code on the forums – use Textile to format your code blocks using bc. for the code block followed by a p. tag to turn it off. See Textile for more info.

Offline

#5 2012-07-23 13:28:05

alarius
Member
Registered: 2009-05-28
Posts: 45

Re: something wrong in my menu and homepage

I try to change in “section” tab the “on frontpage” option,
between homepage and article section, and it seems work the same,
so I’m not sure I have understood the meaning of this… I could say “doesn’t matter, it works!”, but I’d like to understand why it works the same…

and in fact there is still something wrong.

Last edited by alarius (2012-07-23 14:44:56)

Offline

#6 2012-07-23 13:43:18

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: something wrong in my menu and homepage

Any section set to publish on the front page will have that section’s articles retrieved by the <txp:article /> tag. See the article tag reference along with article_custom for more info.

Offline

#7 2012-07-23 14:49:45

alarius
Member
Registered: 2009-05-28
Posts: 45

Re: something wrong in my menu and homepage

i’m confused…
in the homepage it appears the most recent, and not the one I have set to sticky.
If I change the section from “articles” to “homepage” the “homepage” article disappear, both if I set it sticky or live…
There is something (or probably too many things) I don’t understand reading the reference of tags.

Offline

#8 2012-07-23 22:14:54

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: something wrong in my menu and homepage

<txp:article /> displays only live articles by default. If you want it to display sticky articles, use <txp:article status="sticky" />. Unfortunately there is no way to display both live and sticky articles with just one tag, so if that is what you need, you need to use two tags.

Offline

#9 2012-07-24 10:53:50

alarius
Member
Registered: 2009-05-28
Posts: 45

Re: something wrong in my menu and homepage

Hi and thankyou Els!
So, I have created an article section, with all the articles divided in various subcategories.
This section uses an article page and my default style
Than I have my homepage section, wich uses a homepage page and my default style
with only one article assigned to it; In this homepage page I put the <txp:article status="sticky" />
to have it “always on top”. But how I tell txp to use that homepage?
At the moment it still takes the last inserted article; note that I have all the section “on front page”;
If I put “on front page” only the homepage section, I see nothing, and even the category_list_menu on the sidebar output nothing;

Last edited by alarius (2012-07-24 11:37:37)

Offline

#10 2012-07-24 11:37:58

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,315

Re: something wrong in my menu and homepage

If I understand from quickly skimming: Admin > Sections > Default > uses page “homepage”


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#11 2012-07-24 13:38:30

alarius
Member
Registered: 2009-05-28
Posts: 45

Re: something wrong in my menu and homepage

no, I have this:
Admin > Sections >

Default >
uses page default
uses style default

Homepage >
uses page homepage
uses style default

articles >
uses page default
uses style default

probably there is more of something I don’t understand.
I don’t want someone do it for me, but I’d like someone guide me through the right steps…

Last edited by alarius (2012-07-24 14:01:36)

Offline

#12 2012-07-24 14:23:59

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: something wrong in my menu and homepage

Textpattern uses a special section called “default” for all major content such as categories, search, author etc etc. As Uli indicated, if you set the “default” section to use your “homepage” page template, you’ll most likely see the sticky article show up.

Offline

Board footer

Powered by FluxBB