Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2013-12-18 11:40:05

j0nr
Member
Registered: 2013-12-06
Posts: 10

Why is Excerpt Listing so Complicated?

Hi all,

I don’t get why one has to do a certain amount of “coding” just to get an excerpt listing. Surely this is a basic function of any blog type website. Especially when the ability to write an excerpt is provided, but no setting is provided to actually show them.

I am sorry, but I cannot figure out just how to simple display excerpt only in all my listings. Can anyone make it a bit simple for me please?

Thanks in advance.

Jon

Offline

#2 2013-12-18 11:51:40

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,547
Website GitHub Twitter

Re: Why is Excerpt Listing so Complicated?

Hi

you must tell us wich code are you using in your template in order for us to help you, you can chack the textpattern wiki for some information, but basically the excerpt is showeb using <txp:excerpt /> tag into the article form that display articles in the website.

Cheers

Offline

#3 2013-12-18 11:57:07

j0nr
Member
Registered: 2013-12-06
Posts: 10

Re: Why is Excerpt Listing so Complicated?

Hi Dragondz

I think its best to say I am just using the base system as it is downloaded. I haven’t altered it much. I am still learning my way around, as to what page displays what and which form etc…sorry finding it all a bit confusing at the moment.

As far as I can see there is a form called “article_listing” which contains:

<!-- if the article has an excerpt, display that -->
    <txp:if_excerpt>
      <div itemprop="description">
        <txp:excerpt />
      </div>
    </txp:if_excerpt>

That to me looks like it should be displaying an excerpt (as I have typed some in). But I still get the whole article showing in the listing.

Thanks.

Offline

#4 2013-12-18 12:34:15

etc
Developer
Registered: 2010-11-11
Posts: 5,393
Website GitHub

Re: Why is Excerpt Listing so Complicated?

Hi j0nr,

the article_listing form is not used automatically, you should evoke it expressly where needed, like in <txp:article_custom section="something" form="article_listing" />. Or check the content of the default form.

Offline

#5 2013-12-18 12:55:07

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,547
Website GitHub Twitter

Re: Why is Excerpt Listing so Complicated?

Hi Jon

I know that textpattern is not easy when we discover it, but after the fisrt moments all will be easier and fun!

Like Oleg said you must go into form : default_form and there you check if txp:excerptis used instead of txp:body

Cheers.

Offline

#6 2013-12-18 14:40:38

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,564
Website GitHub Mastodon

Re: Why is Excerpt Listing so Complicated?

You can see the article_listing form in action here. The first two articles have an excerpt, so it’s shown. The third article does not.

Offline

#7 2013-12-18 14:43:48

j0nr
Member
Registered: 2013-12-06
Posts: 10

Re: Why is Excerpt Listing so Complicated?

Well… I fixed it. I created a new form called excerpt.

In my default page template, towards the bottom, I changed this:

...<txp:else />
            <!-- else display articles normally -->
           <txp:article limit="5" />
<!-- links by default to form: 'default.article.txp' unless you specify a different form -->
          </txp:if_author>...

to this:

...<txp:else />
            <!-- else display articles normally -->
          <txp:article form="default" listform="excerpt" />
<!-- links by default to form: 'default.article.txp' unless you specify a different form -->
          </txp:if_author>...

And then in forms > excerpt:

<h1><txp:permlink><txp:title /></txp:permlink></h1>
<txp:beginning length="250" format="inside" linktext="Read More" styleclass="morelink" cfield="continue" />

As you can see I am making use of the wonderful beginning plugin to automatically create excerpts.

I really think this should be a default option.

Nice new forum BTW :)

Offline

#8 2013-12-19 08:11:31

TNT
Member
From: Rotterdam, Netherlands
Registered: 2006-01-06
Posts: 256
Website

Re: Why is Excerpt Listing so Complicated?

Maybe a little OT, but shouldn’t txp:beginning have a separate prefix? (I noticed the plugin is around since 2008, so my remark is a bit… slow…)


Prrrrrrrr

Offline

#9 2013-12-19 08:19:36

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: Why is Excerpt Listing so Complicated?

TNT wrote #277439:

Maybe a little OT, but shouldn’t txp:beginning have a separate prefix? (I noticed the plugin is around since 2008, so my remark is a bit… slow…)

It indeed should, but implementing it is up to the developer. He just decided to skip development guidelines and created a tag function without a prefix.

Offline

Board footer

Powered by FluxBB