Jump to content

Pages - How to insert just an article teaser into topic


xtech

Recommended Posts

Hi,

i have an IP Pages creating a forum topic for each article, for comments. The thing is, IP pages also puts the whole content of the article into the topic. As google may complain about the duplicate content, i would like to know if it could put just a "teaser" of the article instead of the whole text and how can i do this.

I suppose i have to edit any file, but i don't know which one.

May somebody help me?

Link to comment
Share on other sites

29 minutes ago, xtech said:

You have several ways. The easiest and less cpu intensive is to create a "teaser" field and showing it instead of the whole content (that's what i did).

The other one is to trim it in realtime using JS or PHP.

I didn't see an option for field type: "teaser" in the field settings, so I did some searching and found out that a teaser field is just a text area.

https://community.invisionpower.com/topic/405376-pages-question-regarding-fields/?do=findComment&comment=2523110

So I tried using field type "text area", but it is still showing the full article in the topic.Am I missing a setting somewhere?

Link to comment
Share on other sites

44 minutes ago, opentype said:

You need to activate the new teaser field for the post, and DEACTIVATE the regular content field with the full article. 

Thanks opentype. Where can I deactivate the regular content field with the full article? I'm not seeing the option...

Link to comment
Share on other sites

1 hour ago, openfire said:

I didn't see an option for field type: "teaser" in the field settings, so I did some searching and found out that a teaser field is just a text area.

Exactly. It's just a text area or text. You then insert there what you want. I ususally paste one of the content paragraphs there.

Quote

https://community.invisionpower.com/topic/405376-pages-question-regarding-fields/?do=findComment&comment=2523110

So I tried using field type "text area", but it is still showing the full article in the topic.Am I missing a setting somewhere?

Yes, you need to de-activate the content field. Remove the {$value} variable on the content field. Ad {$value} on the teaser field.

Edit: I've seen that opentype has already answered!

Link to comment
Share on other sites

Ahhhhh OK. I see what I was doing wrong. :rolleyes:

What this does is allow you to enter your teaser text manually when you are adding the article, in addition to your article content.

All this time, I thought the teaser text was supposed to be generated automatically. :frantics:

Got it now. Long day.

Thanks for the help guys!

Link to comment
Share on other sites

You can generate it automatically... but you have to trim the variable in php (or JS). Instead of {$value} in the content field you can put something like (this is the php version):

{{$trimmedValue = substr($value, 0, 160); /*If you want the first 160 characters*/ }}
{$trimmedValue}

Be careful with this: you should strip the html tags first. And you sentences or words can be cut with this simple approach. If you really want this, you have to perform more checks and refinements.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...