Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-09-22 14:19:21

theartofweb
Member
From: Rome, Italy
Registered: 2008-09-22
Posts: 15
Website

sections link straight to the article

Hi,

I was wondering how I could have an item on the left sidebar menu (sections) link straight to the article, not to the list of articles for that section…do I have to create a fake menu?

thanks


Alla batteria dai retta ballA

Offline

#2 2008-09-22 16:20:16

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

Re: sections link straight to the article

Do you mean that you want all items of your menu to display the section title as link text, but to link to a specific article in that section? Or is it just one item that has to do this, while the other items are normal section links (linking to the section home page, i.e. article list)?

Offline

#3 2008-09-22 16:36:43

theartofweb
Member
From: Rome, Italy
Registered: 2008-09-22
Posts: 15
Website

Re: sections link straight to the article

I am sorry I did not make myself understood. I am creating a personal web page. I would like left sidebar to look like this: About, Portfolio, Contact. Now when I click on “About” I would like some info about me to show up like a regular page, not a page with links


Alla batteria dai retta ballA

Offline

#4 2008-09-22 16:49:55

theartofweb
Member
From: Rome, Italy
Registered: 2008-09-22
Posts: 15
Website

Re: sections link straight to the article

that is to say, I write an about article called “about me” and then save it on the “about” section. On my home page I click on About button I get to www.mysite.com/about where there’s a list with one topic….that’s the point…I’d like my post “about me” to show now I dont want to click on “about me” link and get to www.mysite/about/about-me


Alla batteria dai retta ballA

Offline

#5 2008-09-22 16:52:13

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

Re: sections link straight to the article

Please post the contents of your txp:article tag in the About page, and the form that it calls (usually the default form).

Offline

#6 2008-09-22 17:22:04

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: sections link straight to the article

In other words, you are trying to display your “about-me” article when you are just on “/about/” section
There are different ways to achieve what you want.

<txp:if_article_list>
<txp:article_custom id="id-of-about-me-article" form="a-form-that-displays-the-full-article" />
<txp:else />
<txp:article form="another-form-or-maybe-the-same-form" />
</txp:if_article_list>

Check this thread for other similar ideas.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#7 2008-09-22 17:23:51

redbot
Plugin Author
Registered: 2006-02-14
Posts: 1,410

Re: sections link straight to the article

theartofweb wrote:

that is to say, I write an about article called “about me” and then save it on the “about” section. On my home page I click on About button I get to www.mysite.com/about where there’s a list with one topic….that’s the point…I’d like my post “about me” to show now I dont want to click on “about me” link and get to www.mysite/about/about-me

There are many ways to achieve what you want. I would do this:
save your “about me” article as “sticky” and not “Live” (in the upper right corner under the “write” tab).
Then, in the page you are using for section “about” (which I suppose is the “default” page) add:

<txp:article status "sticky" form="article_sticky" />

finally you have to create a form called “article_sticky” (or whatever you want) for your sticky article, something like:

<txp:title />
<txp:body />

edit: Oops! Maniqui was faster

Last edited by redbot (2008-09-22 17:24:45)

Offline

#8 2008-09-22 17:28:06

theartofweb
Member
From: Rome, Italy
Registered: 2008-09-22
Posts: 15
Website

Re: sections link straight to the article

As you can see in the textpattern site there’s a “download” link in the left sidebar…it gets to a download page with some text…how can I do that?


Alla batteria dai retta ballA

Offline

#9 2008-09-22 17:38:06

theartofweb
Member
From: Rome, Italy
Registered: 2008-09-22
Posts: 15
Website

Re: sections link straight to the article

…ok i read your replies bub how about this: maybe I should write an “About” article in the write panel and tie it to a given section although it wont have anything to do with that as there won’t be any sections shown.

Then in the preferences panel I should change the Permanent link mode from /section/title to /title

Then I should setup a fake menu by creating a form like this:

<a href=”/about”>About Me</a> and put it in the left sidebar of the “default” page…that’s all I can think of


Alla batteria dai retta ballA

Offline

#10 2008-09-22 17:55:22

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

Re: sections link straight to the article

I think you are not quite understanding what maniqui and redbot have said – the best thing is post your page contents (the part where you use the txp:article tag) and the corresponding form. If the txp:article tag has no form attributes, then you are using the default form, so post that form or whichever one you are using.

Offline

#11 2008-09-22 18:03:36

theartofweb
Member
From: Rome, Italy
Registered: 2008-09-22
Posts: 15
Website

Re: sections link straight to the article

thanks for your help! it is working now, that is what I just did:

I created a new form called “displayform” type “article” containing this code:

<div class=“entry-content”>
<txp:body />
</div>

I created an “About” section and tied it to the “defaultpage” page. In the Default page I pasted this code shortly after the <!— center —> code and before the <txp:if_category> tag nad saved:

<txp:if_article_list>
<txp:article_custom id=“7” form=“displayform” />
</txp:if_article_list>

I created an about me page status: Sticky, Section: about.

now, what is the difference between:

<txp:if_article_list>
<txp:article_custom id=“7” form=“displayform” />
</txp:if_article_list>

and:

<txp:article status “sticky” form=“article_sticky” />

???

thanks ever so much


Alla batteria dai retta ballA

Offline

#12 2008-09-22 18:18:19

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

Re: sections link straight to the article

You don’t really need to do anything complicated – a sticky article is simply an article which is outside the normal flow of articles. Think of it as a special way to display a special article, for example, a short introduction or a special promotion. Something that always appears, with the rest of the articles underneath.

For your about page, you simply wanted (as I understand it) to remove the link to the about-me article. This is simple to achieve.

Case 1:

You want your About page to be like this:

  • About me article
  • Article 1
  • Article 2 etc etc

To achieve the above, use:

<txp:article status="sticky" form="displayform" limit="1" />
<txp:article form="your other form" limit="5" /> (this will display the first 5 articles)

Case 2.

You just want one article to appear on the About page:

  • About me
  • Nothing else!

To achieve this, use:

<txp:article form="displayform" limit="1" />

The above will work if you want a static About page, with only one article in it.

Offline

Board footer

Powered by FluxBB