Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-06-22 12:31:49

elduderino
Member
From: Whitstable. south-East England
Registered: 2006-01-02
Posts: 175
Website

just a single article in one div?

Hi there,

Ive intergrated my site in to textpattern. I only want to use textpattern to update one element of my site. Its for a client that runs a letting agency and they want a ‘property of the month’ section.

Now basically all ive done is take my finished code from my code editor and created a new ‘page’ and new ‘style’ in textpattern and then created a new section that uses both of these.

So now im not too sure how to just get one single article intergrated in to my design.

On top of this it needs to work so that everytime a new ‘property of the month is posted it replaces the old one.

Can this be done??

Thanks for reading!

Last edited by elduderino (2006-06-22 13:29:14)

Offline

#2 2006-06-22 13:30:47

guiguibonbon
Member
Registered: 2006-02-20
Posts: 296

Re: just a single article in one div?

Shure. Well, at least if I got your question right. Just put a <tpx:article_custom section="PropretyOfTheMonth" limit="1" listform="Single" /> in the right div.

Last edited by guiguibonbon (2006-06-22 13:31:13)

Offline

#3 2006-06-22 13:37:26

elduderino
Member
From: Whitstable. south-East England
Registered: 2006-01-02
Posts: 175
Website

Re: just a single article in one div?

ok, So i take it that limit=“1” limits the posting to just one, so that every time a new post is published it replaces the last?
do i have to create my own form called txp:article_custom form in the forms section and then adjust it to how i want it? Or is the custom form something that already exists?

Last edited by elduderino (2006-06-22 13:49:00)

Offline

#4 2006-06-22 13:52:23

Elenita
Member
From: Falls Church, VA
Registered: 2004-05-16
Posts: 407
Website

Re: just a single article in one div?

<blockquote>i take it thaty i have to create my own form called txp:article_custom form in the forms section and then adjust it to how i want it? Or is the custom form something that already exists?</blockquote>

<code><txp:article_custom /></code> is an <a href=“http://textpattern.net/wiki/index.php?title=Txp:article_custom_/”>already existing tag</a>. The only thing you’d need to create is a form to control the display of a single article.

Offline

#5 2006-06-22 14:02:23

elduderino
Member
From: Whitstable. south-East England
Registered: 2006-01-02
Posts: 175
Website

Re: just a single article in one div?

Right. I think i understand. By using the article custom_form along with section it means that the article is constrained to that section only. Am i right? So if i have a section named ‘property’ my code would look like this: (?)

tpx:article_custom section=“Property” limit=“1” listform=“Single” /

Now how do i tie a form that ive created myself to all this, like you’ve said Elenita??

Last edited by elduderino (2006-06-22 14:51:41)

Offline

#6 2006-06-22 14:54:44

Elenita
Member
From: Falls Church, VA
Registered: 2004-05-16
Posts: 407
Website

Re: just a single article in one div?

First things first: the <code>listform</code> attribute has been depreciated. Use <code>form</code> instead. Otherwise, the code in the previous post will work fine.

And elduderino, it’s possible that I’m missing something about why you’re confused about forms. Because from where I’m sitting, all you need to do is to change the form attribute to point to the form of your choice. It doesn’t have to be the Single form—that was just an example.

Offline

#7 2006-06-22 15:09:05

elduderino
Member
From: Whitstable. south-East England
Registered: 2006-01-02
Posts: 175
Website

Re: just a single article in one div?

Hi elenita,

Thanks for replying so promptly.

Ive dont this:

( by the way im using the default section here. Ive put my html and css templates in to it…..is that wrong?)

tpx:article_custom section=“default” limit=“1” form=“single” /

I put this in the div i want the article in.

Then i went to write and tried to chose the default section but it wasnt there as an option. I chose single form wrote an article and published.

Nothing happened. nothing appeared….unsurprisingly! I known im really missing something here.

Last edited by elduderino (2006-06-22 15:15:14)

Offline

#8 2006-06-22 15:24:06

Elenita
Member
From: Falls Church, VA
Registered: 2004-05-16
Posts: 407
Website

Re: just a single article in one div?

<blockquote>( by the way im using the default section here. Ive put my html and css templates in to it…..is that wrong?)</blockquote>

The default section has no articles of its own; it just pulls content from other sections. Thus, when you call for it, there are no articles to display.

Offline

#9 2006-06-22 15:34:10

elduderino
Member
From: Whitstable. south-East England
Registered: 2006-01-02
Posts: 175
Website

Re: just a single article in one div?

right but i want this page, the pne thats going to include the custom article, to be the first page of the site. Thats why ive made it the default one. i dont want to create another section to put the page in and then have to link to it from my default page.

Does that make sense?!

Last edited by elduderino (2006-06-22 15:39:41)

Offline

#10 2006-06-22 15:43:22

Elenita
Member
From: Falls Church, VA
Registered: 2004-05-16
Posts: 407
Website

Re: just a single article in one div?

Now it’s me who is confused.

When you post articles for the property of month, what section do you post them in?

Offline

#11 2006-06-22 15:48:06

elduderino
Member
From: Whitstable. south-East England
Registered: 2006-01-02
Posts: 175
Website

Re: just a single article in one div?

I only have one section im using at the moment and that is the default section. Ive directed the default section to use my page template and my css template that ive brought in from my code editor

Ive gone in to my page template and put the code you suggested in to the relevant div, the one i want to put my property of the month article in. Then i went to write, set the article type to single ( just to test it out) and then tried to set the section to default, but, of course, its not there.

do i need to make a new section? I feel as if im missing a bit of information !

sorry to confuse you!

Last edited by elduderino (2006-06-22 15:51:34)

Offline

#12 2006-06-22 16:02:06

Elenita
Member
From: Falls Church, VA
Registered: 2004-05-16
Posts: 407
Website

Re: just a single article in one div?

If you take a look at the content —-> write tab, you’ll notice that you <em>can’t</em> post to the default section directly. It doesn’t even come up as an option. You need to create a non-default section to post articles in. There’s no need to create a template for that section, and no need for you to leave any kind of permalink for visitors to click on or anything. But having a default section and nothing else won’t work.

Offline

Board footer

Powered by FluxBB